From 2d0bd825a6ea832a0db2b6a93ff3c17a8dba72ac Mon Sep 17 00:00:00 2001 From: Meik Date: Mon, 10 Nov 2025 18:37:37 +0100 Subject: [PATCH] =?UTF-8?q?Link=20am=20Betrieb=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StoreWatchPage.js | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/components/StoreWatchPage.js b/src/components/StoreWatchPage.js index 75d72b3..dd7fdd2 100644 --- a/src/components/StoreWatchPage.js +++ b/src/components/StoreWatchPage.js @@ -240,7 +240,7 @@ const StoreWatchPage = ({ authorizedFetch, knownStores = [], userLocation }) => const storeId = String(store.id || store.storeId); const existing = prev.find((entry) => entry.storeId === storeId); if (checked) { - if (existing) { + if (store.isOpen || existing) { return prev; } setDirty(true); @@ -323,9 +323,26 @@ const StoreWatchPage = ({ authorizedFetch, knownStores = [], userLocation }) => ), cell: ({ row }) => ( -
-

{row.original.name}

-

#{row.original.id}

+
+
+

+ {row.original.name} +

+

#{row.original.id}

+
+ + + + + + +
), sortingFn: 'alphanumeric', @@ -380,7 +397,7 @@ const StoreWatchPage = ({ authorizedFetch, knownStores = [], userLocation }) => const label = value ? new Date(value).toLocaleDateString('de-DE', { year: 'numeric', month: '2-digit', day: '2-digit' }) : '–'; - return
{label}
; + return
{label}
; }, sortingFn: (rowA, rowB, columnId) => { const a = rowA.getValue(columnId); @@ -541,6 +558,7 @@ const StoreWatchPage = ({ authorizedFetch, knownStores = [], userLocation }) => cell: ({ row }) => { const store = row.original; const checked = watchedIds.has(String(store.id)); + const disabled = store.isOpen; return (
className="h-5 w-5" checked={checked} onChange={(event) => handleToggleStore(store, event.target.checked)} + disabled={disabled} + title={ + disabled ? 'Store ist bereits offen – Überwachung nicht verfügbar.' : undefined + } />
);