Cloud: DataStore Fixes
This commit is contained in:
parent
66b1063024
commit
3887561047
1 changed files with 9 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue