fix waitUntil failing with arrays and objects (#1028)

This commit is contained in:
Uriel authored and GitHub committed 2024-06-14 17:21:16 +02:00
1 parent 37de960c1b
commit ec2909406b
1 file changed
+8 -4
+8 -4
View File
@@ -103,8 +103,10 @@ export function useConfigProvider(): ConfigContext {
const newConfig: Partial<Config> = 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<Config> = 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,