From ff3589d1575ce1698a306e60e91d13070c955b77 Mon Sep 17 00:00:00 2001 From: Lewis Crichton Date: Sat, 15 Apr 2023 13:50:00 +0100 Subject: [PATCH] CloudSync: fix accidently applying stale settings (#915 * modify the cloud timestamp before importing * use util/native relaunch * lambda why * "should work!" - Vendicated, 15th April 2023 --- src/Vencord.ts | 7 +++---- src/utils/settingsSync.ts | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Vencord.ts b/src/Vencord.ts index f11ca16..ad79345 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -27,14 +27,13 @@ export { PlainSettings, Settings }; import "./utils/quickCss"; import "./webpack/patchWebpack"; -import { relaunch } from "@utils/native"; - import { showNotification } from "./api/Notifications"; import { PlainSettings, Settings } from "./api/settings"; import { patches, PMLogger, startAllPlugins } from "./plugins"; import { localStorage } from "./utils/localStorage"; +import { relaunch } from "./utils/native"; import { getCloudSettings, putCloudSettings } from "./utils/settingsSync"; -import { checkForUpdates, rebuild, update,UpdateLogger } from "./utils/updater"; +import { checkForUpdates, rebuild, update, UpdateLogger } from "./utils/updater"; import { onceReady } from "./webpack"; import { SettingsRouter } from "./webpack/common"; @@ -57,7 +56,7 @@ async function syncSettings() { title: "Cloud Settings", body: "Your settings have been updated! Click here to restart to fully apply changes!", color: "var(--green-360)", - onClick: () => window.DiscordNative.app.relaunch() + onClick: relaunch }); } } diff --git a/src/utils/settingsSync.ts b/src/utils/settingsSync.ts index d1348e1..ff49529 100644 --- a/src/utils/settingsSync.ts +++ b/src/utils/settingsSync.ts @@ -35,6 +35,7 @@ export async function importSettings(data: string) { } if ("settings" in parsed && "quickCss" in parsed) { + Object.assign(PlainSettings, parsed.settings); await VencordNative.ipc.invoke(IpcEvents.SET_SETTINGS, JSON.stringify(parsed.settings, null, 4)); await VencordNative.ipc.invoke(IpcEvents.SET_QUICK_CSS, parsed.quickCss); } else