Fix Kalender-Suche: Sync-Fehler sichtbar, force-sync beim Kalender-Refresh, Backdrop opak
This commit is contained in:
@@ -1859,9 +1859,9 @@ function GlobalSearch({ setActive, setDevToolsNav, mobile }) {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Backdrop zum Schließen */}
|
||||
{/* Backdrop zum Schließen – leicht opak damit Dashboard nicht durchscheint */}
|
||||
{showDropdown && (
|
||||
<div style={{position:'fixed',inset:0,zIndex:8999}} onClick={close}/>
|
||||
<div style={{position:'fixed',inset:0,zIndex:8999,background:'rgba(0,0,0,0.25)'}} onClick={close}/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
@@ -1875,7 +1875,9 @@ function Dashboard({ toast, mobile, setActive, setDevToolsNav, unreadMsgs=0, unr
|
||||
useEffect(() => { const t = setInterval(() => setNow(new Date()), 30000); return () => clearInterval(t); }, []);
|
||||
// Kalender-Events im Hintergrund für die Suche cachen
|
||||
useEffect(() => {
|
||||
api('/search/sync-calendar', { method:'POST', body:{} }).catch(()=>{});
|
||||
api('/search/sync-calendar', { method:'POST', body:{} })
|
||||
.then(r => { if (r.errors?.length) console.warn('[CalendarSync]', r); })
|
||||
.catch(e => console.error('[CalendarSync] Fehler:', e));
|
||||
}, []);
|
||||
return (
|
||||
<div style={{ padding: mobile ? '14px 12px 90px' : '36px 44px', maxWidth:1100 }}>
|
||||
|
||||
@@ -121,7 +121,11 @@ export default function CalendarWidget() {
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
const refresh = () => { api('/calendar/feeds').then(f=>{ setFeeds(f); loadFeeds(f); }).catch(()=>{}); };
|
||||
const refresh = () => {
|
||||
api('/calendar/feeds').then(f=>{ setFeeds(f); loadFeeds(f); }).catch(()=>{});
|
||||
// Kalender-Cache für Suche mitsynchronisieren
|
||||
api('/search/sync-calendar', { method:'POST', body:{ force:true } }).catch(()=>{});
|
||||
};
|
||||
// Load on mount so next event shows without opening
|
||||
useEffect(() => { refresh(); }, []);
|
||||
// Reload when opened
|
||||
@@ -172,7 +176,7 @@ export default function CalendarWidget() {
|
||||
<span style={{ color:'rgba(255,255,255,0.35)', fontFamily:'monospace', fontSize:9, flexShrink:0 }}>
|
||||
{nextEvent.allDay
|
||||
? nextEvent.dtstart.toLocaleDateString('de-DE',{day:'numeric',month:'short'})
|
||||
: `${nextEvent.dtstart.toLocaleDateString('de-DE',{day:'2-digit',month:'2-digit'})} ${nextEvent.dtstart.toLocaleTimeString('de-DE',{hour:'2-digit',minute:'2-digit'})}`
|
||||
: nextEvent.dtstart.toLocaleTimeString('de-DE',{hour:'2-digit',minute:'2-digit'})
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user