From 19ce6d1bad9e893b03e39bc066bcc06bd343d3b5 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Tue, 12 Nov 2024 17:44:29 -0800 Subject: [PATCH] Clean up feeds and listeners --- src/app/commands.ts | 5 +- src/app/components/NoteItem.svelte | 5 +- src/app/components/ProfileFeed.svelte | 38 ++++++++---- src/routes/+layout.svelte | 61 ++++++++++++++++++- src/routes/chat/+layout.svelte | 8 +-- src/routes/spaces/[relay]/+layout.svelte | 14 +---- src/routes/spaces/[relay]/[room]/+page.svelte | 14 +---- .../spaces/[relay]/threads/+page.svelte | 50 ++++++++------- 8 files changed, 121 insertions(+), 74 deletions(-) diff --git a/src/app/commands.ts b/src/app/commands.ts index 01108b3..bdd6b99 100644 --- a/src/app/commands.ts +++ b/src/app/commands.ts @@ -268,7 +268,7 @@ export const setInboxRelayPolicy = (url: string, enabled: boolean) => { export const checkRelayAccess = async (url: string, claim = "") => { const connection = ctx.net.pool.get(url) - await connection.auth.attempt() + await connection.auth.attempt(5000) const thunk = publishThunk({ event: createEvent(AUTH_JOIN, {tags: [["claim", claim]]}), @@ -309,9 +309,10 @@ export const checkRelayAuth = async (url: string) => { const connection = ctx.net.pool.get(url) const okStatuses = [AuthStatus.None, AuthStatus.Ok] - await connection.auth.attempt() + await connection.auth.attempt(5000) if (!okStatuses.includes(connection.auth.status)) { + console.log(connection.auth.status, connection) return `Failed to authenticate: "${connection.auth.message}"` } } diff --git a/src/app/components/NoteItem.svelte b/src/app/components/NoteItem.svelte index fff92a5..8add8a0 100644 --- a/src/app/components/NoteItem.svelte +++ b/src/app/components/NoteItem.svelte @@ -3,7 +3,7 @@ import type {NativeEmoji} from "emoji-picker-element/shared" import type {TrustedEvent} from "@welshman/util" import {REACTION} from "@welshman/util" - import {pubkey, load, formatTimestamp} from "@welshman/app" + import {pubkey, load} from "@welshman/app" import Icon from "@lib/components/Icon.svelte" import EmojiButton from "@lib/components/EmojiButton.svelte" import Content from "@app/components/Content.svelte" @@ -40,8 +40,5 @@ -

- {formatTimestamp(event.created_at)} -

diff --git a/src/app/components/ProfileFeed.svelte b/src/app/components/ProfileFeed.svelte index 4df4238..de146ab 100644 --- a/src/app/components/ProfileFeed.svelte +++ b/src/app/components/ProfileFeed.svelte @@ -1,10 +1,10 @@ diff --git a/src/routes/spaces/[relay]/[room]/+page.svelte b/src/routes/spaces/[relay]/[room]/+page.svelte index 028eee5..6eced4d 100644 --- a/src/routes/spaces/[relay]/[room]/+page.svelte +++ b/src/routes/spaces/[relay]/[room]/+page.svelte @@ -8,9 +8,8 @@