mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
mobile: update database sync api to use new sync options
This commit is contained in:
committed by
Abdullah Atta
parent
a4e777b24b
commit
722aa7b9c6
@@ -262,7 +262,7 @@ const onEvent = async ({ type, detail }: Event) => {
|
|||||||
if (status.isInternetReachable) {
|
if (status.isInternetReachable) {
|
||||||
try {
|
try {
|
||||||
if (!globalThis["IS_MAIN_APP_RUNNING" as never]) {
|
if (!globalThis["IS_MAIN_APP_RUNNING" as never]) {
|
||||||
await db.sync(false, false);
|
await db.sync({ type: "send", force: false });
|
||||||
} else {
|
} else {
|
||||||
console.log("main app running, skipping sync");
|
console.log("main app running, skipping sync");
|
||||||
}
|
}
|
||||||
@@ -904,7 +904,7 @@ async function pinNote(id: string) {
|
|||||||
const note = db.notes?.note(id as string) as any;
|
const note = db.notes?.note(id as string) as any;
|
||||||
let text = await convertNoteToText(note as any, false);
|
let text = await convertNoteToText(note as any, false);
|
||||||
if (!text) text = "";
|
if (!text) text = "";
|
||||||
let 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,
|
||||||
|
|||||||
@@ -79,7 +79,11 @@ const run = async (
|
|||||||
try {
|
try {
|
||||||
await BackgroundSync.doInBackground(async () => {
|
await BackgroundSync.doInBackground(async () => {
|
||||||
try {
|
try {
|
||||||
await db.sync(full, forced, lastSyncTime);
|
await db.sync({
|
||||||
|
type: full ? "full" : "send",
|
||||||
|
force: forced,
|
||||||
|
lastSyncTime
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = e;
|
error = e;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ const ShareView = ({ quicknote = false }) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (!globalThis["IS_MAIN_APP_RUNNING"]) {
|
if (!globalThis["IS_MAIN_APP_RUNNING"]) {
|
||||||
await db.sync(false, false);
|
await db.sync({ type: "send", force: false });
|
||||||
} else {
|
} else {
|
||||||
console.log("main app running, skipping sync");
|
console.log("main app running, skipping sync");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user