Avoid showing auth error before join dialog
This commit is contained in:
parent
774e2da463
commit
9cb5e54aeb
1 changed files with 13 additions and 11 deletions
|
|
@ -41,18 +41,20 @@
|
|||
// Direct links skip Discover — prompt to join when relay is not in the user's space list.
|
||||
$effect(() => {
|
||||
if ($modal) return
|
||||
if ($authError) return showAuthError()
|
||||
if ($relaysPendingTrust.includes(url)) return showPendingTrust()
|
||||
if ($userSpaceUrls.includes(url)) return
|
||||
if (joinPrompted.has(url)) return
|
||||
|
||||
if (spacesLoaded) {
|
||||
joinPrompted.add(url)
|
||||
pushModal(SpaceJoin, {url})
|
||||
} else {
|
||||
loadUserGroupList([url]).then(() => {
|
||||
spacesLoaded = true
|
||||
})
|
||||
if (!$userSpaceUrls.includes(url) && !joinPrompted.has(url)) {
|
||||
if (spacesLoaded) {
|
||||
joinPrompted.add(url)
|
||||
pushModal(SpaceJoin, {url})
|
||||
} else {
|
||||
loadUserGroupList([url]).then(() => {
|
||||
spacesLoaded = true
|
||||
})
|
||||
}
|
||||
} else if ($authError) {
|
||||
showAuthError()
|
||||
} else if ($relaysPendingTrust.includes(url)) {
|
||||
showPendingTrust()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue