Cloud: DataStore Fixes

This commit is contained in:
thororen 2026-08-26 18:50:48 -04:00
parent 66b1063024
commit 3887561047
No known key found for this signature in database

View file

@ -112,10 +112,19 @@ async function applyDownloads(downloads: SyncResponse["downloads"]) {
} else if (dl.key === "quickCss") {
await VencordNative.quickCss.set(text);
settingsChanged = true;
} else if (dl.key === "dataStore") {
try {
const entries = JSON.parse(text);
await DataStore.setMany(entries);
settingsChanged = true;
} catch (e) {
logger.error("Failed to apply dataStore download", e);
}
} else if (dl.key.startsWith("dataStore/")) {
const dsKey = dl.key.slice("dataStore/".length);
try {
await DataStore.set(dsKey, JSON.parse(text));
settingsChanged = true;
} catch (e) {
logger.error(`Failed to apply dataStore download for ${dsKey}`, e);
}