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
+22
View File
@@ -756,3 +756,25 @@ export const getLastSuccessSyncByVault = async (
`${vaultRandomID}-lastSuccessSyncMillis`
)) as number;
};
export const upsertPluginVersionByVault = async (
db: InternalDBs,
vaultRandomID: string,
newVersion: string
) => {
let oldVersion: string | null = await db.simpleKVForMiscTbl.getItem(
`${vaultRandomID}-pluginversion`
);
if (oldVersion === null) {
oldVersion = "0.0.0";
}
await db.simpleKVForMiscTbl.setItem(
`${vaultRandomID}-pluginversion`,
newVersion
);
return {
oldVersion: oldVersion,
newVersion: newVersion,
};
};