1
0
mirror of https://github.com/XFox111/TabsAsideExtension.git synced 2026-04-22 07:58:01 +03:00

feat: ability to disable cloud collection storage

This commit is contained in:
2025-05-04 14:21:10 +03:00
parent 70ed16c286
commit e59782973b
10 changed files with 103 additions and 9 deletions
@@ -1,14 +1,17 @@
import { CollectionItem } from "@/models/CollectionModels";
import getLogger from "@/utils/getLogger";
import { collectionStorage } from "./collectionStorage";
import getCollectionsFromCloud from "./getCollectionsFromCloud";
import getCollectionsFromLocal from "./getCollectionsFromLocal";
import saveCollectionsToLocal from "./saveCollectionsToLocal";
import getLogger from "@/utils/getLogger";
const logger = getLogger("getCollections");
export default async function getCollections(): Promise<[CollectionItem[], CloudStorageIssueType | null]>
{
if (await collectionStorage.disableCloud.getValue() === true)
return [await getCollectionsFromLocal(), null];
const lastUpdatedLocal: number = await collectionStorage.localLastUpdated.getValue();
const lastUpdatedSync: number = await collectionStorage.syncLastUpdated.getValue();