Detect nip29 properly before choosing smart path, more robust auth error checking

This commit is contained in:
Jon Staab
2025-11-04 16:14:32 -08:00
parent 6429f82829
commit 501ce8067d
12 changed files with 56 additions and 45 deletions
+7 -8
View File
@@ -3,7 +3,6 @@
import {page} from "$app/stores"
import {once} from "@welshman/lib"
import Page from "@lib/components/Page.svelte"
import Dialog from "@lib/components/Dialog.svelte"
import SecondaryNav from "@lib/components/SecondaryNav.svelte"
import MenuSpace from "@app/components/MenuSpace.svelte"
import SpaceAuthError from "@app/components/SpaceAuthError.svelte"
@@ -23,7 +22,11 @@
const authError = deriveRelayAuthError(url)
const showAuthError = once(() => pushModal(SpaceAuthError, {url, error: $authError}))
const showAuthError = once(() =>
pushModal(SpaceAuthError, {url, error: $authError}, {noEscape: true}),
)
const showPendingTrust = once(() => pushModal(SpaceTrustRelay, {url}, {noEscape: true}))
// We have to watch this one, since on mobile the badge will be visible when active
$effect(() => {
@@ -36,6 +39,8 @@
$effect(() => {
if ($authError) {
showAuthError()
} else if ($relaysPendingTrust.includes(url)) {
showPendingTrust()
}
})
</script>
@@ -48,9 +53,3 @@
{@render children?.()}
{/key}
</Page>
{#if $relaysPendingTrust.includes(url)}
<Dialog>
<SpaceTrustRelay {url} />
</Dialog>
{/if}