Simplify invite timeout handling

This commit is contained in:
2026-04-16 03:26:48 +05:30
parent 45480a04b1
commit 7c2897b65d
+6 -11
View File
@@ -40,17 +40,12 @@
onMount(async () => {
try {
const [[event]] = await Promise.all([
Promise.race([
request({
relays: [url],
autoClose: true,
signal: AbortSignal.timeout(10000),
filters: [{kinds: [RELAY_INVITE]}],
}),
sleep(10000).then(() => {
throw new Error("Invite claim timed out")
}),
]),
request({
relays: [url],
autoClose: true,
signal: AbortSignal.timeout(10000),
filters: [{kinds: [RELAY_INVITE]}],
}),
sleep(2000),
])