mirror of
https://github.com/XFox111/TabsAsideExtension.git
synced 2026-04-22 07:58:01 +03:00
fix!: incorrect byte calculation for cloud storage (changed encoding)
This commit is contained in:
@@ -14,7 +14,7 @@ export default async function getCollectionsFromCloud(): Promise<CollectionItem[
|
|||||||
const chunks: Record<string, string> =
|
const chunks: Record<string, string> =
|
||||||
await browser.storage.sync.get(getChunkKeys(0, chunkCount)) as Record<string, string>;
|
await browser.storage.sync.get(getChunkKeys(0, chunkCount)) as Record<string, string>;
|
||||||
|
|
||||||
const data: string = decompress(Object.values(chunks).join(), { inputEncoding: "StorageBinaryString" });
|
const data: string = decompress(Object.values(chunks).join(), { inputEncoding: "Base64" });
|
||||||
|
|
||||||
return parseCollections(data);
|
return parseCollections(data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export default async function saveCollectionsToCloud(collections: CollectionItem
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const data: string = compress(serializeCollections(collections), { outputEncoding: "StorageBinaryString" });
|
const data: string = compress(serializeCollections(collections), { outputEncoding: "Base64" });
|
||||||
const chunks: string[] = splitIntoChunks(data);
|
const chunks: string[] = splitIntoChunks(data);
|
||||||
|
|
||||||
if (chunks.length > collectionStorage.maxChunkCount)
|
if (chunks.length > collectionStorage.maxChunkCount)
|
||||||
|
|||||||
Reference in New Issue
Block a user