From d713a738eec85582e67d203d671043f6ff1869bf Mon Sep 17 00:00:00 2001 From: Dicken Date: Tue, 26 May 2026 14:57:28 +0200 Subject: [PATCH] Dateien nach "frontend/src" hochladen --- frontend/src/calendar.jsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/src/calendar.jsx b/frontend/src/calendar.jsx index 02c9c87..84c8be3 100644 --- a/frontend/src/calendar.jsx +++ b/frontend/src/calendar.jsx @@ -86,9 +86,9 @@ export default function CalendarWidget() { const [today] = useState(new Date()); const [cur, setCur] = useState({ y: today.getFullYear(), m: today.getMonth() }); const [events, setEvents] = useState([]); - const [feeds, setFeeds] = useState(() => { - try { return JSON.parse(localStorage.getItem('dd_cal_feeds') || '[]'); } catch { return []; } - }); + // Feeds immer frisch aus localStorage lesen + const getFeeds = () => { try { return JSON.parse(localStorage.getItem('dd_cal_feeds') || '[]'); } catch { return []; } }; + const [feedCount, setFeedCount] = useState(0); // trigger re-render const [loading, setLoading] = useState(false); const [selected, setSelected] = useState(null); // date object @@ -121,7 +121,8 @@ export default function CalendarWidget() { setLoading(false); }; - useEffect(() => { if (isOpen && feeds.length > 0) loadFeeds(feeds); }, [isOpen]); + const refresh = () => { const f = getFeeds(); if (f.length > 0) loadFeeds(f); setFeedCount(f.length); }; + useEffect(() => { if (isOpen) refresh(); }, [isOpen]); // Calendar grid const days = useMemo(() => { @@ -150,8 +151,8 @@ export default function CalendarWidget() { - {isOpen && feeds.length > 0 && ( -