forked from coracle/flotilla
Default to light mode
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
LOCALE,
|
||||
parseJson,
|
||||
fromPairs,
|
||||
last,
|
||||
} from "@welshman/lib"
|
||||
import {decrypt} from "@welshman/signer"
|
||||
import type {Feed} from "@welshman/feeds"
|
||||
@@ -314,8 +315,12 @@ export const checkRelayAuth = async (url: string) => {
|
||||
|
||||
// Only raise an error if it's not a timeout.
|
||||
// If it is, odds are the problem is with our signer, not the relay
|
||||
if (!okStatuses.includes(socket.auth.status) && socket.auth.details) {
|
||||
return `Failed to authenticate (${socket.auth.details})`
|
||||
if (!okStatuses.includes(socket.auth.status)) {
|
||||
if (socket.auth.details) {
|
||||
return `Failed to authenticate (${socket.auth.details})`
|
||||
} else {
|
||||
return `Failed to authenticate (${last(socket.auth.status.split(":"))})`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
tryCatch,
|
||||
} from "@welshman/lib"
|
||||
import type {Socket} from "@welshman/net"
|
||||
import {Pool, load, AuthStateEvent, SocketEvent, netContext} from "@welshman/net"
|
||||
import {Pool, load, AuthStateEvent, AuthStatus, SocketEvent, netContext} from "@welshman/net"
|
||||
import {
|
||||
collection,
|
||||
custom,
|
||||
@@ -815,7 +815,7 @@ export const deriveRelayAuthError = (url: string, claim = "") => {
|
||||
return derived(
|
||||
[relaysMostlyRestricted, deriveSocket(url)],
|
||||
([$relaysMostlyRestricted, $socket]) => {
|
||||
if ($socket.auth.details) {
|
||||
if ($socket.auth.status === AuthStatus.Forbidden && $socket.auth.details) {
|
||||
return stripPrefix($socket.auth.details)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user