diff options
| author | Fuwn <[email protected]> | 2026-02-09 23:32:00 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-09 23:32:00 -0800 |
| commit | e2543a0d1ca7b7014bcc34fafb68dfdea792da75 (patch) | |
| tree | 3e3fe4e6c36d458c5e602cb74ec6ccca8843ec8a | |
| parent | feat: offline support tier 3 — mutation queue and image caching (diff) | |
| download | asa.news-e2543a0d1ca7b7014bcc34fafb68dfdea792da75.tar.xz asa.news-e2543a0d1ca7b7014bcc34fafb68dfdea792da75.zip | |
fix: use online networkMode for offline mutations instead of offlineFirst
offlineFirst fires the mutation once even when offline, causing a
network error that triggers onError and rolls back the optimistic
update. online mode pauses the mutation without calling mutationFn,
keeping the optimistic state intact until reconnection.
| -rw-r--r-- | apps/web/lib/query-client.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/web/lib/query-client.ts b/apps/web/lib/query-client.ts index 1e500a0..421fc3a 100644 --- a/apps/web/lib/query-client.ts +++ b/apps/web/lib/query-client.ts @@ -16,7 +16,7 @@ export function createQueryClient() { refetchOnWindowFocus: false, }, mutations: { - networkMode: "offlineFirst", + networkMode: "online", gcTime: TWENTY_FOUR_HOURS_IN_MILLISECONDS, }, }, |