Increase useAuthor timeout and retries for Capacitor WebView
WebSocket connections take longer to establish on first load in Capacitor. Increase timeout from 8s to 15s and retries from 3 to 5. Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
parent
0d9cfa61fb
commit
a6c220c911
1 changed files with 3 additions and 3 deletions
|
|
@ -20,7 +20,7 @@ export function useAuthor(pubkey: string | undefined) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const querySignal = AbortSignal.any([signal, AbortSignal.timeout(8000)]);
|
const querySignal = AbortSignal.any([signal, AbortSignal.timeout(15000)]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Try main relays first
|
// Try main relays first
|
||||||
|
|
@ -60,7 +60,7 @@ export function useAuthor(pubkey: string | undefined) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
staleTime: 60 * 1000, // 1 minute — allows NostrSync to invalidate and refetch quickly
|
staleTime: 60 * 1000, // 1 minute — allows NostrSync to invalidate and refetch quickly
|
||||||
retry: 3,
|
retry: 5,
|
||||||
retryDelay: (attemptIndex) => Math.min(1000 * 2 ** attemptIndex, 8000),
|
retryDelay: (attemptIndex) => Math.min(1000 * 2 ** attemptIndex, 10000),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue