From c65b13e8aacb3c08cce2bbd75e735738332e7453 Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 7 Feb 2024 17:10:18 +0100 Subject: [PATCH] chore: using new function from the previous commit --- frontend/src/ts/db.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/frontend/src/ts/db.ts b/frontend/src/ts/db.ts index 07f986c0a..28fac62ef 100644 --- a/frontend/src/ts/db.ts +++ b/frontend/src/ts/db.ts @@ -144,19 +144,12 @@ export async function initSnapshot(): Promise< // LoadingPage.updateBar(32); // } // LoadingPage.updateText("Downloading config..."); - if (configData !== undefined && configData !== null) { - const newConfig = { + if (configData === undefined || configData === null) { + snap.config = { ...DefaultConfig, }; - - for (const key in configData.config) { - const value = configData.config[key]; - (newConfig[ - key as keyof MonkeyTypes.Config - ] as typeof configData[typeof key]) = value; - } - - snap.config = newConfig; + } else { + snap.config = mergeWithDefaultConfig(configData.config); } // if (ActivePage.get() === "loading") { // LoadingPage.updateBar(67.5);