Stop publishing join requests every time we open a space
This commit is contained in:
@@ -73,7 +73,6 @@ import {
|
|||||||
waitForThunkError,
|
waitForThunkError,
|
||||||
getPubkeyRelays,
|
getPubkeyRelays,
|
||||||
userBlossomServerList,
|
userBlossomServerList,
|
||||||
getThunkError,
|
|
||||||
addRoomMember,
|
addRoomMember,
|
||||||
manageRelay,
|
manageRelay,
|
||||||
getRelay,
|
getRelay,
|
||||||
@@ -264,16 +263,12 @@ export const attemptRelayAccess = async (url: string, claim = "") => {
|
|||||||
return stripPrefix(error)
|
return stripPrefix(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const deriveRelayAuthError = (url: string, claim = "") => {
|
export const deriveRelayAuthError = (url: string) => {
|
||||||
// Kick off the auth process
|
|
||||||
Pool.get().get(url).auth.attemptAuth(sign)
|
Pool.get().get(url).auth.attemptAuth(sign)
|
||||||
|
|
||||||
// Attempt to join the relay
|
|
||||||
const thunk = publishJoinRequest({url, claim})
|
|
||||||
|
|
||||||
return derived(
|
return derived(
|
||||||
[thunk, relaysMostlyRestricted, deriveSocket(url)],
|
[relaysMostlyRestricted, deriveSocket(url)],
|
||||||
([$thunk, $relaysMostlyRestricted, $socket]) => {
|
([$relaysMostlyRestricted, $socket]) => {
|
||||||
if ($socket.auth.status === AuthStatus.Forbidden && $socket.auth.details) {
|
if ($socket.auth.status === AuthStatus.Forbidden && $socket.auth.details) {
|
||||||
return stripPrefix($socket.auth.details)
|
return stripPrefix($socket.auth.details)
|
||||||
}
|
}
|
||||||
@@ -281,16 +276,6 @@ export const deriveRelayAuthError = (url: string, claim = "") => {
|
|||||||
if ($relaysMostlyRestricted[url]) {
|
if ($relaysMostlyRestricted[url]) {
|
||||||
return stripPrefix($relaysMostlyRestricted[url])
|
return stripPrefix($relaysMostlyRestricted[url])
|
||||||
}
|
}
|
||||||
|
|
||||||
const error = getThunkError($thunk)
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
const isEmptyInvite = !claim && error.includes("invite code")
|
|
||||||
|
|
||||||
if (!shouldIgnoreError(error) && !isEmptyInvite) {
|
|
||||||
return stripPrefix(error) || "join request rejected"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user