fix(web): Daten nach Aktionen ohne Refresh aktuell
staleTime war 30 s → nach „Lock in" zeigte das Dashboard bis zu 30 s alte Cache-Stände, erst ein Browser-Refresh half. Jetzt staleTime 0: Seiten holen beim Aufrufen/Tab-Fokus frische Daten (kein Polling). Zusätzlich invalidiert checkIn jetzt dashboard.overview, dayEntry.todayTeam und todayPresence, damit ein offenes Dashboard sofort mitzieht. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b7b54fcec5
commit
1f0c9efd59
2 files changed
+9
-1
No files matched your search
@@ -11,7 +11,11 @@ export function TrpcProvider({ children }: { children: React.ReactNode }) {
|
||||
new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: 30_000,
|
||||
// staleTime 0: beim Aufrufen einer Seite / Tab-Fokus werden Daten
|
||||
// neu geholt, statt bis zu 30 s veraltete Cache-Stände zu zeigen
|
||||
// (sonst landeten Aktionen wie „Lock in" erst nach Refresh im
|
||||
// Dashboard). Kein Polling — nur Refetch bei Mount/Fokus.
|
||||
staleTime: 0,
|
||||
retry: 1,
|
||||
},
|
||||
mutations: {
|
||||
|
||||
@@ -59,6 +59,10 @@ function CheckInForm({ onDone }: { onDone: () => void }) {
|
||||
toast(msg);
|
||||
await utils.dayEntry.today.invalidate();
|
||||
await utils.dayEntry.pendingCarryOver.invalidate();
|
||||
// Dashboard-Sichten sofort mitziehen (Quote, Anwesenheit, „Heute im Team").
|
||||
await utils.dayEntry.todayTeam.invalidate();
|
||||
await utils.dayEntry.todayPresence.invalidate();
|
||||
await utils.dashboard.overview.invalidate();
|
||||
onDone();
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user