From 0f7b9f588ecc5c95af047d86b8680b5feb0b73dc Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Tue, 4 Jul 2023 23:57:28 +0800 Subject: [PATCH] perf(cloud sync): minify synced settings (#1377) --- src/utils/settingsSync.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/settingsSync.ts b/src/utils/settingsSync.ts index bcf59be14..850d45f4c 100644 --- a/src/utils/settingsSync.ts +++ b/src/utils/settingsSync.ts @@ -41,10 +41,10 @@ export async function importSettings(data: string) { throw new Error("Invalid Settings. Is this even a Vencord Settings file?"); } -export async function exportSettings() { +export async function exportSettings({ minify }: { minify?: boolean; } = {}) { const settings = JSON.parse(VencordNative.settings.get()); const quickCss = await VencordNative.quickCss.get(); - return JSON.stringify({ settings, quickCss }, null, 4); + return JSON.stringify({ settings, quickCss }, null, minify ? undefined : 4); } export async function downloadSettingsBackup() { @@ -122,7 +122,7 @@ export async function uploadSettingsBackup(showToast = true): Promise { const cloudSettingsLogger = new Logger("Cloud:Settings", "#39b7e0"); export async function putCloudSettings() { - const settings = await exportSettings(); + const settings = await exportSettings({ minify: true }); try { const res = await fetch(new URL("/v1/settings", getCloudUrl()), {