fix: improve error handling for user settings retrieval in GET and settings store

This commit is contained in:
Linus Rath
2026-03-24 14:20:10 +01:00
parent e07365b066
commit d666bddbc4
2 changed files with 6 additions and 5 deletions
+5 -1
View File
@@ -510,10 +510,14 @@ export const useSettingsStore = create<SettingsState>()(
},
});
if (!res.ok) {
syncLog('No server settings found (status', res.status + ')');
syncLog('Settings fetch failed (status', res.status + ')');
return false;
}
const { settings } = await res.json();
if (!settings) {
syncLog('No server settings found yet');
return false;
}
if (settings && typeof settings === 'object') {
isLoadingFromServer = true;
get().importSettings(JSON.stringify(settings));