From 870f37835de29677d17cc87f70f680227cb2d00c Mon Sep 17 00:00:00 2001 From: deveshanim3 Date: Fri, 17 Apr 2026 18:10:47 +0530 Subject: [PATCH 1/2] fixed : "Create Invite" shows wrong error message when offline --- src/app/components/SpaceInvite.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/components/SpaceInvite.svelte b/src/app/components/SpaceInvite.svelte index d748798e..708375b4 100644 --- a/src/app/components/SpaceInvite.svelte +++ b/src/app/components/SpaceInvite.svelte @@ -25,6 +25,9 @@ const {url} = $props() const authError = deriveRelayAuthError(url) + let networkError = $state(false) + const isExplicitAuthError = $derived($authError && !($authError.toLowerCase().includes("failed") || $authError.toLowerCase().includes("timeout") || $authError.toLowerCase().includes("network"))) + const isGenericError = $derived(networkError || ($authError && !isExplicitAuthError)) const back = () => history.back() const copyInvite = () => clip(invite) @@ -70,8 +73,11 @@ ]) claim = getTagValue("claim", event?.tags || []) || "" - } catch { + } catch (err) { claim = "" + if ((err instanceof Error && (err.name === "AbortError" || err.name === "TimeoutError")) || !navigator.onLine) { + networkError = true + } } finally { loading = false } @@ -92,7 +98,9 @@

Requesting an invite link...

- {:else if $authError} + {:else if isGenericError} +

Unable to reach the relay. Please check your connection and try again.

+ {:else if isExplicitAuthError}

Oops! It looks like you're not a member of this relay.

{:else}
-- 2.52.0 From 79a4e22cd4f99c3a30540d703fe64601a3402d01 Mon Sep 17 00:00:00 2001 From: deveshanim3 Date: Fri, 17 Apr 2026 20:00:52 +0530 Subject: [PATCH 2/2] fix:"Create Invite" shows wrong error message when offline --- src/app/components/SpaceInvite.svelte | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/app/components/SpaceInvite.svelte b/src/app/components/SpaceInvite.svelte index 708375b4..f28c22c7 100644 --- a/src/app/components/SpaceInvite.svelte +++ b/src/app/components/SpaceInvite.svelte @@ -26,7 +26,14 @@ const authError = deriveRelayAuthError(url) let networkError = $state(false) - const isExplicitAuthError = $derived($authError && !($authError.toLowerCase().includes("failed") || $authError.toLowerCase().includes("timeout") || $authError.toLowerCase().includes("network"))) + const isExplicitAuthError = $derived( + $authError && + !( + $authError.toLowerCase().includes("failed") || + $authError.toLowerCase().includes("timeout") || + $authError.toLowerCase().includes("network") + ), + ) const isGenericError = $derived(networkError || ($authError && !isExplicitAuthError)) const back = () => history.back() @@ -75,7 +82,10 @@ claim = getTagValue("claim", event?.tags || []) || "" } catch (err) { claim = "" - if ((err instanceof Error && (err.name === "AbortError" || err.name === "TimeoutError")) || !navigator.onLine) { + if ( + (err instanceof Error && (err.name === "AbortError" || err.name === "TimeoutError")) || + !navigator.onLine + ) { networkError = true } } finally { @@ -99,7 +109,9 @@ Requesting an invite link...

{:else if isGenericError} -

Unable to reach the relay. Please check your connection and try again.

+

+ Unable to reach the relay. Please check your connection and try again. +

{:else if isExplicitAuthError}

Oops! It looks like you're not a member of this relay.

{:else} -- 2.52.0