mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 11:39:21 +02:00
Compare commits
3 Commits
3.3.21-and
...
fix/text-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17023d949f | ||
|
|
e09b1a556a | ||
|
|
ff379a52db |
@@ -586,7 +586,7 @@ export class VaultDialog extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _copyNote(note) {
|
async _copyNote(note) {
|
||||||
Clipboard.setString(await convertNoteToText(note));
|
Clipboard.setString((await convertNoteToText(note, true)) || "");
|
||||||
ToastManager.show({
|
ToastManager.show({
|
||||||
heading: "Note copied",
|
heading: "Note copied",
|
||||||
type: "success",
|
type: "success",
|
||||||
@@ -602,7 +602,7 @@ export class VaultDialog extends Component {
|
|||||||
await Share.open({
|
await Share.open({
|
||||||
heading: "Share note",
|
heading: "Share note",
|
||||||
failOnCancel: false,
|
failOnCancel: false,
|
||||||
message: await convertNoteToText(note)
|
message: (await convertNoteToText(note)) || ""
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|||||||
@@ -600,20 +600,11 @@ export const useActions = ({
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const text = await convertNoteToText(item as Note, false);
|
const text = await convertNoteToText(item as Note, true);
|
||||||
if (!text) {
|
const html = (text || "").replace(/\n/g, "<br />");
|
||||||
ToastManager.error(
|
|
||||||
new Error(Errors.export("text")),
|
|
||||||
undefined,
|
|
||||||
"local"
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const html = text.replace(/\n/g, "<br />");
|
|
||||||
await Notifications.displayNotification({
|
await Notifications.displayNotification({
|
||||||
title: item.title,
|
title: item.title,
|
||||||
message: (item as Note).headline || text,
|
message: (item as Note).headline || text || "",
|
||||||
subtitle: "",
|
subtitle: "",
|
||||||
bigText: html,
|
bigText: html,
|
||||||
ongoing: true,
|
ongoing: true,
|
||||||
@@ -684,15 +675,11 @@ export const useActions = ({
|
|||||||
} else {
|
} else {
|
||||||
processingId.current = "shareNote";
|
processingId.current = "shareNote";
|
||||||
const convertedText = await convertNoteToText(item);
|
const convertedText = await convertNoteToText(item);
|
||||||
if (!convertedText) {
|
|
||||||
ToastManager.error(new Error(Errors.export("text")));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
processingId.current = undefined;
|
processingId.current = undefined;
|
||||||
Share.open({
|
Share.open({
|
||||||
title: "Share note to",
|
title: "Share note to",
|
||||||
failOnCancel: false,
|
failOnCancel: false,
|
||||||
message: convertedText
|
message: convertedText || ""
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -772,11 +759,7 @@ export const useActions = ({
|
|||||||
} else {
|
} else {
|
||||||
processingId.current = "copyContent";
|
processingId.current = "copyContent";
|
||||||
const text = await convertNoteToText(item as Note, true);
|
const text = await convertNoteToText(item as Note, true);
|
||||||
if (!text) {
|
Clipboard.setString(text || "");
|
||||||
ToastManager.error(new Error(Errors.export("text")));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Clipboard.setString(text);
|
|
||||||
processingId.current = undefined;
|
processingId.current = undefined;
|
||||||
ToastManager.show({
|
ToastManager.show({
|
||||||
heading: "Note copied to clipboard",
|
heading: "Note copied to clipboard",
|
||||||
|
|||||||
@@ -952,13 +952,13 @@ async function pinNote(id: string) {
|
|||||||
const note = await db.notes.note(id as string);
|
const note = await db.notes.note(id as string);
|
||||||
if (!note) return;
|
if (!note) return;
|
||||||
|
|
||||||
let text = await convertNoteToText(note, false);
|
let text = await convertNoteToText(note, true);
|
||||||
if (!text) text = "";
|
if (!text) text = "";
|
||||||
const html = text.replace(/\n/g, "<br />");
|
const html = text.replace(/\n/g, "<br />");
|
||||||
Notifications.displayNotification({
|
Notifications.displayNotification({
|
||||||
title: note.title,
|
title: note.title,
|
||||||
message: note.headline || text,
|
message: note.headline || text,
|
||||||
subtitle: note.headline || text,
|
subtitle: "",
|
||||||
bigText: html,
|
bigText: html,
|
||||||
ongoing: true,
|
ongoing: true,
|
||||||
actions: ["UNPIN"],
|
actions: ["UNPIN"],
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export const IOS_APPGROUPID = "group.org.streetwriters.notesnook";
|
|||||||
export const FILE_SIZE_LIMIT = 500 * 1024 * 1024;
|
export const FILE_SIZE_LIMIT = 500 * 1024 * 1024;
|
||||||
export const IMAGE_SIZE_LIMIT = 50 * 1024 * 1024;
|
export const IMAGE_SIZE_LIMIT = 50 * 1024 * 1024;
|
||||||
|
|
||||||
export const BETA = true;
|
export const BETA = false;
|
||||||
|
|
||||||
export const STORE_LINK =
|
export const STORE_LINK =
|
||||||
Platform.OS === "ios"
|
Platform.OS === "ios"
|
||||||
|
|||||||
Reference in New Issue
Block a user