mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
web: update database sync api to use new sync options
This commit is contained in:
committed by
Abdullah Atta
parent
af7120e953
commit
a4e777b24b
@@ -298,7 +298,11 @@ class AppStore extends BaseStore {
|
||||
|
||||
this.updateSyncStatus("syncing");
|
||||
try {
|
||||
const result = await db.sync(full, force, lastSynced);
|
||||
const result = await db.sync({
|
||||
type: full ? "full" : "send",
|
||||
force,
|
||||
serverLastSynced: lastSynced
|
||||
});
|
||||
|
||||
if (!result) return this.updateSyncStatus("failed");
|
||||
this.updateSyncStatus("completed", true);
|
||||
@@ -307,7 +311,6 @@ class AppStore extends BaseStore {
|
||||
|
||||
if (pendingSync) {
|
||||
logger.info("Running pending sync", pendingSync);
|
||||
pendingSync = false;
|
||||
await this.get().sync(pendingSync.full, false);
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
@@ -358,7 +358,7 @@ function RecoveryKeyMethod(props: BaseRecoveryComponentProps<"method:key">) {
|
||||
const user = await db.user?.getUser();
|
||||
if (!user) throw new Error("User not authenticated");
|
||||
await db.storage?.write(`_uk_@${user.email}@_k`, form.recoveryKey);
|
||||
await db.sync(true, true);
|
||||
await db.sync({ type: "fetch", force: true });
|
||||
navigate("backup");
|
||||
}}
|
||||
>
|
||||
@@ -507,7 +507,7 @@ function NewPassword(props: BaseRecoveryComponentProps<"new">) {
|
||||
|
||||
if (formData?.backupFile) {
|
||||
await restoreBackupFile(formData?.backupFile);
|
||||
await db.sync(true, true);
|
||||
await db.sync({ type: "full", force: true });
|
||||
}
|
||||
|
||||
navigate("final");
|
||||
|
||||
Reference in New Issue
Block a user