summaryrefslogtreecommitdiff
path: root/apps/web
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-09 23:32:00 -0800
committerFuwn <[email protected]>2026-02-09 23:32:00 -0800
commite2543a0d1ca7b7014bcc34fafb68dfdea792da75 (patch)
tree3e3fe4e6c36d458c5e602cb74ec6ccca8843ec8a /apps/web
parentfeat: offline support tier 3 — mutation queue and image caching (diff)
downloadasa.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.
Diffstat (limited to 'apps/web')
-rw-r--r--apps/web/lib/query-client.ts2
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,
},
},