fix: Docker update button stuck on 'Loading settings'. Related to #1114

When system settings API fails, the catch blocks in App.tsx now call
markSystemSettingsLoadedWithDefaults() to ensure the UI doesn't stay
permanently in a loading state with disabled update buttons.
This commit is contained in:
rcourtman
2026-01-17 15:55:52 +00:00
parent 432f13b6f5
commit f1b5f06702
2 changed files with 20 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ import { AIChat } from './components/AI/Chat';
import { AIStatusIndicator } from './components/AI/AIStatusIndicator';
import { aiChatStore } from './stores/aiChat';
import { useResourcesAsLegacy } from './hooks/useResources';
import { updateSystemSettingsFromResponse } from './stores/systemSettings';
import { updateSystemSettingsFromResponse, markSystemSettingsLoadedWithDefaults } from './stores/systemSettings';
import { initKioskMode } from './utils/url';
@@ -589,6 +589,8 @@ function App() {
setHasLoadedServerTheme(true);
} catch (error) {
logger.error('Failed to load theme from server', error);
// Ensure settings are marked as loaded so UI doesn't stay in loading state
markSystemSettingsLoadedWithDefaults();
}
}
@@ -637,6 +639,8 @@ function App() {
setHasLoadedServerTheme(true);
} catch (error) {
logger.error('Failed to load theme from server', error);
// Ensure settings are marked as loaded so UI doesn't stay in loading state
markSystemSettingsLoadedWithDefaults();
}
}
@@ -703,7 +707,11 @@ function App() {
// Still load system settings for other features (Docker update actions, etc.)
SettingsAPI.getSystemSettings()
.then((settings) => updateSystemSettingsFromResponse(settings))
.catch((error) => logger.warn('Failed to load system settings', error));
.catch((error) => {
logger.warn('Failed to load system settings', error);
// Ensure settings are marked as loaded so UI doesn't stay in loading state
markSystemSettingsLoadedWithDefaults();
});
}
}
} catch (error) {

View File

@@ -60,6 +60,16 @@ export function areSystemSettingsLoaded(): boolean {
return systemSettingsLoaded();
}
/**
* Mark settings as loaded with default values.
* Call this when settings fail to load but the app should continue working.
*/
export function markSystemSettingsLoadedWithDefaults(): void {
setDisableDockerUpdateActions(false);
setSystemSettingsLoaded(true);
logger.debug('System settings marked as loaded with defaults');
}
/**
* Update the local state when settings change (e.g., from Settings page).
*/