From 52fe83d8156a473096a3539d644623cd5510f4f6 Mon Sep 17 00:00:00 2001 From: kieran Date: Thu, 10 Oct 2024 21:39:09 +0100 Subject: [PATCH] chore: formatting --- src/element/provider/nostr/index.tsx | 44 +++++++++++++++------------- src/hooks/current-stream-feed.ts | 6 ++-- src/providers/zsz.ts | 6 ++-- 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/element/provider/nostr/index.tsx b/src/element/provider/nostr/index.tsx index 84a028a..3b49fd9 100644 --- a/src/element/provider/nostr/index.tsx +++ b/src/element/provider/nostr/index.tsx @@ -189,31 +189,35 @@ export default function NostrProviderDialog({ function currentBalance() { if (!info) return; - return
-

- -

-
-
- + return ( +
+

+ +

+
+
+ +
+ +
- -
-
+ ); } function balanceTimeEstimate() { if (!info) return; - return
- - - -
+ return ( +
+ + + +
+ ); } function streamEditor() { @@ -288,7 +292,7 @@ export default function NostrProviderDialog({ return ( <> {showEndpoints && streamEndpoints()} - {showBalance&& currentBalance()} + {showBalance && currentBalance()} {showEstimate && balanceTimeEstimate()} {streamEditor()} {forwardInputs()} diff --git a/src/hooks/current-stream-feed.ts b/src/hooks/current-stream-feed.ts index 20e5568..bf9fdc0 100644 --- a/src/hooks/current-stream-feed.ts +++ b/src/hooks/current-stream-feed.ts @@ -31,9 +31,9 @@ export function useCurrentStreamFeed(link: NostrLink, leaveOpen = false, evPrelo const q = useRequestBuilder(sub); return useMemo(() => { - const hosting = [...q, ...(evPreload ? [evPreload] : [])].filter( - a => getHost(a) === author || a.pubkey === author - ).sort((a, b) => (b.created_at > a.created_at ? 1 : -1)); + const hosting = [...q, ...(evPreload ? [evPreload] : [])] + .filter(a => getHost(a) === author || a.pubkey === author) + .sort((a, b) => (b.created_at > a.created_at ? 1 : -1)); return hosting.at(0); }, [q]); } diff --git a/src/providers/zsz.ts b/src/providers/zsz.ts index b3358e2..f867df3 100644 --- a/src/providers/zsz.ts +++ b/src/providers/zsz.ts @@ -171,9 +171,11 @@ export class NostrStreamProvider implements StreamProvider { const u = `${this.url}${path}`; const token = await pub.generic(eb => { - return eb.kind(EventKind.HttpAuthentication) + return eb + .kind(EventKind.HttpAuthentication) .content("") - .tag(["u", u]).tag(["method", method]) + .tag(["u", u]) + .tag(["method", method]) .createdAt(unixNow() + Math.floor(TimeSync / 1000)); }); const rsp = await fetch(u, {