Skip to content

Commit

Permalink
Update settingsSync.ts to use SettingsStore for setting values
Browse files Browse the repository at this point in the history
  • Loading branch information
Loukious committed Mar 23, 2024
1 parent 0c92637 commit 7f71f13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/settingsSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import { showNotification } from "@api/Notifications";
import { PlainSettings, Settings } from "@api/Settings";
import { PlainSettings, Settings, SettingsStore } from "@api/Settings";
import { Toasts } from "@webpack/common";
import { deflateSync, inflateSync } from "fflate";

Expand Down Expand Up @@ -137,7 +137,7 @@ export async function putCloudSettings(manual?: boolean) {

const { written } = await res.json();
PlainSettings.cloud.settingsSyncVersion = written;
VencordNative.settings.set(PlainSettings);
VencordNative.settings.set(/* This is really bad but it works */JSON.parse(JSON.stringify(SettingsStore.plain)));

cloudSettingsLogger.info("Settings uploaded to cloud successfully");

Expand Down Expand Up @@ -222,7 +222,7 @@ export async function getCloudSettings(shouldNotify = true, force = false) {

// sync with server timestamp instead of local one
PlainSettings.cloud.settingsSyncVersion = written;
VencordNative.settings.set(PlainSettings);
VencordNative.settings.set(/* This is really bad but it works */JSON.parse(JSON.stringify(SettingsStore.plain)));

cloudSettingsLogger.info("Settings loaded from cloud successfully");
if (shouldNotify)
Expand Down

0 comments on commit 7f71f13

Please sign in to comment.