From a501bb0ca1298db3f601f3c79f5c6662f8d7eea0 Mon Sep 17 00:00:00 2001 From: Meik Date: Mon, 10 Nov 2025 11:34:54 +0100 Subject: [PATCH] fix: buttons not working --- src/App.js | 8 ++++---- src/components/DashboardView.js | 22 +++++++++++++++------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/App.js b/src/App.js index 7c98656..e96ca0c 100644 --- a/src/App.js +++ b/src/App.js @@ -728,10 +728,10 @@ function App() { return; } setIsDirty(true); - const updatedConfig = config.filter((item) => item.id !== entryId); - setConfig(updatedConfig); - setStatus('Eintrag gelöscht!'); - setTimeout(() => setStatus(''), 3000); + await persistConfigUpdate( + (prev) => prev.filter((item) => item.id !== entryId), + 'Eintrag gelöscht!' + ); }; const hideEntry = async (entryId) => { diff --git a/src/components/DashboardView.js b/src/components/DashboardView.js index 1351acf..335f860 100644 --- a/src/components/DashboardView.js +++ b/src/components/DashboardView.js @@ -38,12 +38,20 @@ const DashboardView = ({ return; } const row = document.querySelector(`[data-store-row="${focusedStoreId}"]`); - if (row) { - row.scrollIntoView({ behavior: 'smooth', block: 'center' }); - row.classList.add('ring-2', 'ring-blue-400'); - setTimeout(() => row.classList.remove('ring-2', 'ring-blue-400'), 1500); + if (!row) { + onClearFocus(); + return; } - onClearFocus(); + row.scrollIntoView({ behavior: 'smooth', block: 'center' }); + row.classList.add('ring-2', 'ring-blue-400', 'bg-yellow-100'); + const timeout = setTimeout(() => { + row.classList.remove('ring-2', 'ring-blue-400', 'bg-yellow-100'); + onClearFocus(); + }, 3000); + return () => { + clearTimeout(timeout); + row.classList.remove('ring-2', 'ring-blue-400', 'bg-yellow-100'); + }; }, [focusedStoreId, onClearFocus]); const { error: notificationError, @@ -176,8 +184,8 @@ const DashboardView = ({