mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
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:
@@ -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) {
|
||||
|
||||
@@ -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).
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user