fixing small bugs; improving background handling and removing dead code
Build and Release to Staging / Build Vision Start (push) Successful in 1m6s
Build and Release to Staging / Build Vision Start Image (push) Successful in 2m41s
Build and Release to Staging / Deploy Vision Start (staging) (push) Successful in 18s

This commit is contained in:
ivanch committed 2026-10-28 21:52:07 -03:00
1 parent 99dbea0615
commit 62e187b9f5
24 files changed
+439 -250

No files matched your search

+23 -4
View File
@@ -38,6 +38,15 @@ const App: React.FC = () => {
return () => clearTimeout(timer);
}, []);
useEffect(() => {
const onStorage = (event: StorageEvent) => {
if (event.key === 'config' || event.key === null) setConfig(ConfigurationService.loadConfig());
if (event.key === 'categories' || event.key === null) setCategories(ConfigurationService.loadCategories());
};
window.addEventListener('storage', onStorage);
return () => window.removeEventListener('storage', onStorage);
}, []);
useEffect(() => {
ConfigurationService.saveConfig(config);
}, [config]);
@@ -56,9 +65,19 @@ const App: React.FC = () => {
}, []);
const handleWallpaperChange = useCallback((newConfig: Partial<Config>) => {
setConfig(prev => ({ ...prev, ...newConfig }));
setConfig(prev => {
const next = newConfig.currentWallpapers;
const unchanged = Object.keys(newConfig).length === 1 && next !== undefined
&& next.length === prev.currentWallpapers.length
&& next.every((name, index) => name === prev.currentWallpapers[index]);
return unchanged ? prev : { ...prev, ...newConfig };
});
}, []);
const handleToggleEditing = useCallback(() => setIsEditing(editing => !editing), []);
const handleOpenConfig = useCallback(() => setIsConfigModalOpen(true), []);
const handleRandomWallpaper = useCallback(() => {
const names = config.currentWallpapers;
if (names.length === 0) return;
@@ -171,8 +190,8 @@ const App: React.FC = () => {
wallpaperFrequency={config.wallpaperFrequency}
wallpaperVersion={wallpaperVersion}
/>
<EditButton isEditing={isEditing} onClick={() => setIsEditing(!isEditing)} />
<ConfigurationButton onClick={() => setIsConfigModalOpen(true)} />
<EditButton isEditing={isEditing} onClick={handleToggleEditing} />
<ConfigurationButton onClick={handleOpenConfig} />
<Header config={config} />
@@ -208,7 +227,7 @@ const App: React.FC = () => {
)}
</div>
{config.serverWidget.enabled && <ServerWidget config={config} />}
{config.serverWidget.enabled && <ServerWidget serverWidget={config.serverWidget} />}
{(editingWebsite || addingWebsite) && (
<Suspense fallback={null}>