From ec2909406b7b2f088e1fa8f84aafa0f21a7ea7cc Mon Sep 17 00:00:00 2001 From: Uriel Date: Fri, 14 Jun 2024 17:21:16 +0200 Subject: [PATCH] fix `waitUntil` failing with arrays and objects (#1028) --- gui/src/hooks/config.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gui/src/hooks/config.ts b/gui/src/hooks/config.ts index cc8e79b11..c37309c5c 100644 --- a/gui/src/hooks/config.ts +++ b/gui/src/hooks/config.ts @@ -103,8 +103,10 @@ export function useConfigProvider(): ConfigContext { const newConfig: Partial = JSON.parse( (await store.get('config.json')) ?? '{}' ); - return Object.entries(config).every( - ([key, value]) => newConfig[key as keyof Config] === value + return Object.entries(config).every(([key, value]) => + typeof value === 'object' + ? JSON.stringify(newConfig[key as keyof Config]) === JSON.stringify(value) + : newConfig[key as keyof Config] === value ); }, 100, @@ -116,8 +118,10 @@ export function useConfigProvider(): ConfigContext { const newConfig: Partial = JSON.parse( localStorage.getItem('config.json') ?? '{}' ); - return Object.entries(config).every( - ([key, value]) => newConfig[key as keyof Config] === value + return Object.entries(config).every(([key, value]) => + typeof value === 'object' + ? JSON.stringify(newConfig[key as keyof Config]) === JSON.stringify(value) + : newConfig[key as keyof Config] === value ); }, 100,