fix: buttons not working

This commit is contained in:
2025-11-10 11:34:54 +01:00
parent 6df5cb35de
commit a501bb0ca1
2 changed files with 19 additions and 11 deletions

View File

@@ -728,10 +728,10 @@ function App() {
return; return;
} }
setIsDirty(true); setIsDirty(true);
const updatedConfig = config.filter((item) => item.id !== entryId); await persistConfigUpdate(
setConfig(updatedConfig); (prev) => prev.filter((item) => item.id !== entryId),
setStatus('Eintrag gelöscht!'); 'Eintrag gelöscht!'
setTimeout(() => setStatus(''), 3000); );
}; };
const hideEntry = async (entryId) => { const hideEntry = async (entryId) => {

View File

@@ -38,12 +38,20 @@ const DashboardView = ({
return; return;
} }
const row = document.querySelector(`[data-store-row="${focusedStoreId}"]`); const row = document.querySelector(`[data-store-row="${focusedStoreId}"]`);
if (row) { if (!row) {
row.scrollIntoView({ behavior: 'smooth', block: 'center' }); onClearFocus();
row.classList.add('ring-2', 'ring-blue-400'); return;
setTimeout(() => row.classList.remove('ring-2', 'ring-blue-400'), 1500);
} }
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]); }, [focusedStoreId, onClearFocus]);
const { const {
error: notificationError, error: notificationError,
@@ -176,8 +184,8 @@ const DashboardView = ({
</div> </div>
<button <button
onClick={() => onStoreSelect(store)} onClick={() => onStoreSelect(store)}
disabled={blockedByNoPickups} title={blockedByNoPickups ? 'Keine Pickups automatisch verborgen' : undefined}
className="bg-blue-50 hover:bg-blue-100 text-blue-600 border border-blue-200 px-3 py-1.5 rounded text-sm focus:outline-none focus:ring-2 focus:ring-blue-300 disabled:opacity-60" className="bg-blue-50 hover:bg-blue-100 text-blue-600 border border-blue-200 px-3 py-1.5 rounded text-sm focus:outline-none focus:ring-2 focus:ring-blue-300"
> >
{isVisible ? 'Zur Liste springen' : 'Hinzufügen'} {isVisible ? 'Zur Liste springen' : 'Hinzufügen'}
</button> </button>