diff --git a/src/app/components/ThreadBoardItem.svelte b/src/app/components/ThreadBoardItem.svelte
index 6f2dc129..9b991f4e 100644
--- a/src/app/components/ThreadBoardItem.svelte
+++ b/src/app/components/ThreadBoardItem.svelte
@@ -22,27 +22,27 @@
const title = getTagValue("title", event.tags)
-
-
-
{title || "Untitled thread"}
-
- by
-
-
-
+
+ |
+
+ {title || "Untitled thread"}
+
+ by
+
+
+ |
+
-
-
+ |
+
Replies ·
{replyCount}
-
-
+ |
+
Last ·
{formatTimestamp(lastActive)}
-
-
+ |
+
diff --git a/src/app/policies.ts b/src/app/policies.ts
index 94f6ff2c..31c4570b 100644
--- a/src/app/policies.ts
+++ b/src/app/policies.ts
@@ -99,7 +99,7 @@ export const mostlyRestrictedPolicy = (socket: Socket) => {
const pending = new Set
()
const updateStatus = (error?: string) => {
- if (restricted > total / 2) {
+ if (total > 5 && restricted > total / 2) {
if (error) {
return relaysMostlyRestricted.update(assoc(socket.url, error))
}
diff --git a/src/app/relays.ts b/src/app/relays.ts
index e1091460..0e6bf73d 100644
--- a/src/app/relays.ts
+++ b/src/app/relays.ts
@@ -177,14 +177,24 @@ export const attemptRelayAccess = async (url: string, claim = "") => {
return `Failed to connect`
}
+ // Some relays are extra slow, remove this when welshman is updated
+ await poll({
+ signal: AbortSignal.timeout(3000),
+ condition: () => socket.auth.status === AuthStatus.Requested,
+ })
+
await socket.auth.attemptAuth(sign)
+ // Some relays are extra slow, remove this when welshman is updated
+ await poll({
+ signal: AbortSignal.timeout(3000),
+ condition: () => socket.auth.status !== AuthStatus.PendingResponse,
+ })
+
if (![AuthStatus.None, AuthStatus.Ok].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(":"))})`
- }
+ const message = socket.auth.details || last(socket.auth.status.split(":"))
+
+ return `Failed to authenticate (${message})`
}
const error = await waitForThunkError(publishJoinRequest({url, claim}))
diff --git a/src/app/routes.ts b/src/app/routes.ts
index 2f523445..b44873bc 100644
--- a/src/app/routes.ts
+++ b/src/app/routes.ts
@@ -79,18 +79,22 @@ export const makeSpacePath = (url: string, ...extra: (string | undefined)[]) =>
return path
}
-export const goToSpace = async (url: string) => {
+export const goToSpace = (url: string) => {
const prevPath = lastPageBySpaceUrl.get(encodeRelay(url))
if (prevPath && prevPath !== makeSpacePath(url)) {
- goto(prevPath, {replaceState: true})
- } else if (!hasNip29(getRelay(url))) {
- goto(makeSpaceChatPath(url), {replaceState: true})
- } else if (window.matchMedia(`(min-width: ${theme.screens.md})`).matches) {
- goto(makeSpacePath(url, "about"), {replaceState: true})
- } else {
- goto(makeSpacePath(url), {replaceState: true})
+ return goto(prevPath, {replaceState: true})
}
+
+ if (!hasNip29(getRelay(url))) {
+ return goto(makeSpaceChatPath(url), {replaceState: true})
+ }
+
+ if (window.matchMedia(`(min-width: ${theme.screens.md})`).matches) {
+ return goto(makeSpacePath(url, "about"), {replaceState: true})
+ }
+
+ return goto(makeSpacePath(url), {replaceState: true})
}
// Content types, events