back to the party

This commit is contained in:
fyears
2024-01-07 11:20:57 +08:00
parent 9fba9241dc
commit f3f26f7c0b
7 changed files with 74 additions and 3 deletions
+13
View File
@@ -23,6 +23,7 @@ import {
COMMAND_CALLBACK_ONEDRIVE,
COMMAND_CALLBACK_DROPBOX,
COMMAND_URI,
REMOTELY_SAVE_VERSION_2024PREPARE,
} from "./baseTypes";
import { importQrCodeUri } from "./importExport";
import {
@@ -37,6 +38,7 @@ import {
clearExpiredSyncPlanRecords,
upsertLastSuccessSyncByVault,
getLastSuccessSyncByVault,
upsertPluginVersionByVault,
} from "./localdb";
import { RemoteClient } from "./remote";
import {
@@ -72,6 +74,7 @@ import {
exportVaultSyncPlansToFiles,
} from "./debugMode";
import { SizesConflictModal } from "./syncSizesConflictNotice";
import { compareVersion } from "./misc";
const DEFAULT_SETTINGS: RemotelySavePluginSettings = {
s3: DEFAULT_S3_CONFIG,
@@ -822,6 +825,16 @@ export default class RemotelySavePlugin extends Plugin {
this.enableInitSyncIfSet();
this.enableSyncOnSaveIfSet();
}
// compare versions and read new versions
const { oldVersion } = await upsertPluginVersionByVault(
this.db,
this.vaultRandomID,
this.manifest.version
);
if (compareVersion(REMOTELY_SAVE_VERSION_2024PREPARE, oldVersion) >= 0) {
new Notice(t("official_notice_2024_first_party"), 10 * 1000);
}
}
async onunload() {