diff --git a/packages/app/public/index.html b/packages/app/public/index.html index b5a13832..ee84c3b7 100644 --- a/packages/app/public/index.html +++ b/packages/app/public/index.html @@ -1,4 +1,4 @@ - + diff --git a/packages/app/src/Cache/GiftWrapCache.ts b/packages/app/src/Cache/GiftWrapCache.ts index 67f00b91..71e82b45 100644 --- a/packages/app/src/Cache/GiftWrapCache.ts +++ b/packages/app/src/Cache/GiftWrapCache.ts @@ -38,7 +38,7 @@ export class GiftWrapCache extends RefreshFeedCache { } catch (e) { console.debug(e, v); } - }), + }) ) ) .filter(a => a !== undefined) diff --git a/packages/app/src/Element/CashuNuts.tsx b/packages/app/src/Element/CashuNuts.tsx index 4e124e38..8674657b 100644 --- a/packages/app/src/Element/CashuNuts.tsx +++ b/packages/app/src/Element/CashuNuts.tsx @@ -26,7 +26,7 @@ export default function CashuNuts({ token }: { token: string }) { e.stopPropagation(); const lnurl = profile?.lud16 ?? ""; const url = `https://redeem.cashu.me?token=${encodeURIComponent(token)}&lightning=${encodeURIComponent( - lnurl, + lnurl )}&autopay=yes`; window.open(url, "_blank"); } diff --git a/packages/app/src/Element/FollowButton.tsx b/packages/app/src/Element/FollowButton.tsx index c2cb0e54..64a1dc38 100644 --- a/packages/app/src/Element/FollowButton.tsx +++ b/packages/app/src/Element/FollowButton.tsx @@ -34,7 +34,7 @@ export default function FollowButton(props: FollowButtonProps) { if (publisher) { const ev = await publisher.contactList( follows.item.filter(a => a !== pubkey), - relays.item, + relays.item ); System.BroadcastEvent(ev); } diff --git a/packages/app/src/Element/Nip5Service.tsx b/packages/app/src/Element/Nip5Service.tsx index 5a389c44..19318901 100644 --- a/packages/app/src/Element/Nip5Service.tsx +++ b/packages/app/src/Element/Nip5Service.tsx @@ -261,7 +261,9 @@ export default function Nip5Service(props: Nip05ServiceProps) { />  @  )} diff --git a/packages/app/src/Element/Note.tsx b/packages/app/src/Element/Note.tsx index 85deb9dc..db857738 100644 --- a/packages/app/src/Element/Note.tsx +++ b/packages/app/src/Element/Note.tsx @@ -135,7 +135,7 @@ export function NoteInner(props: NoteProps) { { [Reaction.Positive]: [] as TaggedNostrEvent[], [Reaction.Negative]: [] as TaggedNostrEvent[], - }, + } ); return { [Reaction.Positive]: dedupeByPubkey(result[Reaction.Positive]), @@ -150,7 +150,7 @@ export function NoteInner(props: NoteProps) { ...getReactions(related, ev.id, EventKind.TextNote).filter(e => e.tags.some(tagFilterOfTextRepost(e, ev.id))), ...getReactions(related, ev.id, EventKind.Repost), ]), - [related, ev], + [related, ev] ); const zaps = useMemo(() => { const sortedZaps = getReactions(related, ev.id, EventKind.ZapReceipt) @@ -241,7 +241,7 @@ export function NoteInner(props: NoteProps) { function goToEvent( e: React.MouseEvent, eTarget: TaggedNostrEvent, - isTargetAllowed: boolean = e.target === e.currentTarget, + isTargetAllowed: boolean = e.target === e.currentTarget ) { if (!isTargetAllowed || opt?.canClick === false) { return; diff --git a/packages/app/src/Element/NoteCreator.css b/packages/app/src/Element/NoteCreator.css index 44417017..e879558e 100644 --- a/packages/app/src/Element/NoteCreator.css +++ b/packages/app/src/Element/NoteCreator.css @@ -2,8 +2,7 @@ border: 1px solid transparent; border-radius: 12px; box-shadow: 0px 0px 6px 1px rgba(182, 108, 156, 0.3); - background: - linear-gradient(var(--gray-superdark), var(--gray-superdark)) padding-box, + background: linear-gradient(var(--gray-superdark), var(--gray-superdark)) padding-box, linear-gradient(90deg, #ef9644, #fd7c49, #ff5e58, #ff3b70, #ff088e, #eb00b1, #c31ed5, #7b41f6) border-box; } diff --git a/packages/app/src/Element/NoteCreator.tsx b/packages/app/src/Element/NoteCreator.tsx index 3ea2e7dd..d9a5ab85 100644 --- a/packages/app/src/Element/NoteCreator.tsx +++ b/packages/app/src/Element/NoteCreator.tsx @@ -76,8 +76,8 @@ export function NoteCreator() { setError( formatMessage({ defaultMessage: "Invalid LNURL", - }), - ), + }) + ) ); return; } @@ -256,9 +256,9 @@ export function NoteCreator() { ? false : // otherwise return selectedCustomRelays with target relay added / removed a.filter(el => - el === r ? e.target.checked : !selectedCustomRelays || selectedCustomRelays.includes(el), - ), - ), + el === r ? e.target.checked : !selectedCustomRelays || selectedCustomRelays.includes(el) + ) + ) ) } /> diff --git a/packages/app/src/Element/NoteFooter.tsx b/packages/app/src/Element/NoteFooter.tsx index 068c8ac5..6e74f1f1 100644 --- a/packages/app/src/Element/NoteFooter.tsx +++ b/packages/app/src/Element/NoteFooter.tsx @@ -71,7 +71,7 @@ export default function NoteFooter(props: NoteFooterProps) { }, { captureEvent: true, - }, + } ); function hasReacted(emoji: string) { diff --git a/packages/app/src/Element/Poll.tsx b/packages/app/src/Element/Poll.tsx index 6dd9e046..3be4f388 100644 --- a/packages/app/src/Element/Poll.tsx +++ b/packages/app/src/Element/Poll.tsx @@ -46,15 +46,15 @@ export default function Poll(props: PollProps) { }, { amount, - }, - ), + } + ) ); } setVoting(opt); const r = Object.keys(relays.item); const zap = await publisher.zap(amount * 1000, props.ev.pubkey, r, props.ev.id, undefined, eb => - eb.tag(["poll_option", opt.toString()]), + eb.tag(["poll_option", opt.toString()]) ); const lnurl = props.ev.tags.find(a => a[0] === "zap")?.[1] || pollerProfile?.lud16 || pollerProfile?.lud06; @@ -67,7 +67,7 @@ export default function Poll(props: PollProps) { throw new Error( formatMessage({ defaultMessage: "Can't vote because LNURL service does not support zaps", - }), + }) ); } @@ -84,7 +84,7 @@ export default function Poll(props: PollProps) { setError( formatMessage({ defaultMessage: "Failed to send vote", - }), + }) ); } } finally { diff --git a/packages/app/src/Element/PubkeyList.tsx b/packages/app/src/Element/PubkeyList.tsx index 8a5d14df..17648433 100644 --- a/packages/app/src/Element/PubkeyList.tsx +++ b/packages/app/src/Element/PubkeyList.tsx @@ -34,7 +34,7 @@ export default function PubkeyList({ ev, className }: { ev: NostrEvent; classNam pk, Object.keys(login.relays.item), undefined, - `Zap from ${hexToBech32("note", ev.id)}`, + `Zap from ${hexToBech32("note", ev.id)}` ); const invoice = await svc.getInvoice(amtSend, undefined, zap); if (invoice.pr) { diff --git a/packages/app/src/Element/ReBroadcaster.tsx b/packages/app/src/Element/ReBroadcaster.tsx index 53029aeb..b3ad9dab 100644 --- a/packages/app/src/Element/ReBroadcaster.tsx +++ b/packages/app/src/Element/ReBroadcaster.tsx @@ -55,9 +55,9 @@ export function ReBroadcaster() { ? false : // otherwise return selectedCustomRelays with target relay added / removed a.filter(el => - el === r ? e.target.checked : !selectedCustomRelays || selectedCustomRelays.includes(el), - ), - ), + el === r ? e.target.checked : !selectedCustomRelays || selectedCustomRelays.includes(el) + ) + ) ) } /> diff --git a/packages/app/src/Element/Reactions.tsx b/packages/app/src/Element/Reactions.tsx index 076089c2..cd755b26 100644 --- a/packages/app/src/Element/Reactions.tsx +++ b/packages/app/src/Element/Reactions.tsx @@ -60,7 +60,7 @@ const Reactions = ({ show, setShow, positive, negative, reposts, zaps }: Reactio value: 3, }, ] - : [], + : [] ); const [tab, setTab] = useState(tabs[0]); diff --git a/packages/app/src/Element/Relay.tsx b/packages/app/src/Element/Relay.tsx index 0de4d288..1fca237a 100644 --- a/packages/app/src/Element/Relay.tsx +++ b/packages/app/src/Element/Relay.tsx @@ -22,7 +22,7 @@ export default function Relay(props: RelayProps) { const navigate = useNavigate(); const login = useLogin(); const relaySettings = unwrap( - login.relays.item[props.addr] ?? System.Sockets.find(a => a.address === props.addr)?.settings ?? {}, + login.relays.item[props.addr] ?? System.Sockets.find(a => a.address === props.addr)?.settings ?? {} ); const state = useRelayState(props.addr); const name = useMemo(() => getRelayName(props.addr), [props.addr]); @@ -34,7 +34,7 @@ export default function Relay(props: RelayProps) { ...login.relays.item, [props.addr]: o, }, - unixNowMs(), + unixNowMs() ); } diff --git a/packages/app/src/Element/SendSats.tsx b/packages/app/src/Element/SendSats.tsx index 1c0823f0..368095d9 100644 --- a/packages/app/src/Element/SendSats.tsx +++ b/packages/app/src/Element/SendSats.tsx @@ -285,7 +285,7 @@ export default function SendSats(props: SendSatsProps) { {makeTab(ZapType.AnonZap, )} {makeTab( ZapType.NonZap, - , + )} diff --git a/packages/app/src/Element/Thread.tsx b/packages/app/src/Element/Thread.tsx index 73532db7..ee6512b5 100644 --- a/packages/app/src/Element/Thread.tsx +++ b/packages/app/src/Element/Thread.tsx @@ -243,7 +243,7 @@ export default function Thread() { if (t?.root?.key === "a" && t?.root?.value) { const parsed = t.root.value.split(":"); replyTo = thread.data?.find( - a => a.kind === Number(parsed[0]) && a.pubkey === parsed[1] && findTag(a, "d") === parsed[2], + a => a.kind === Number(parsed[0]) && a.pubkey === parsed[1] && findTag(a, "d") === parsed[2] )?.id; } if (replyTo) { @@ -264,7 +264,7 @@ export default function Thread() { thread.data?.find( ne => ne.id === currentId || - (link.type === NostrPrefix.Address && findTag(ne, "d") === currentId && ne.pubkey === link.author), + (link.type === NostrPrefix.Address && findTag(ne, "d") === currentId && ne.pubkey === link.author) ) ?? (location.state && "sig" in location.state ? (location.state as TaggedNostrEvent) : undefined); if (currentNote) { const currentThread = EventExt.extractThread(currentNote); @@ -280,7 +280,7 @@ export default function Thread() { if (replyTo.key === "a" && replyTo.value) { const parsed = replyTo.value.split(":"); return thread.data?.find( - a => a.kind === Number(parsed[0]) && a.pubkey === parsed[1] && findTag(a, "d") === parsed[2], + a => a.kind === Number(parsed[0]) && a.pubkey === parsed[1] && findTag(a, "d") === parsed[2] ); } if (replyTo.value) { @@ -348,7 +348,7 @@ export default function Thread() { notes={replies} related={getAllReactions( thread.data, - replies.map(a => a.id), + replies.map(a => a.id) )} chains={chains} onNavigate={navigateThread} diff --git a/packages/app/src/Element/Timeline.tsx b/packages/app/src/Element/Timeline.tsx index 0b5c545a..acdd1221 100644 --- a/packages/app/src/Element/Timeline.tsx +++ b/packages/app/src/Element/Timeline.tsx @@ -47,7 +47,7 @@ const Timeline = (props: TimelineProps) => { ?.filter(a => (props.postsOnly ? !a.tags.some(b => b[0] === "e") : true)) .filter(a => props.ignoreModeration || !isMuted(a.pubkey)); }, - [props.postsOnly, muted, props.ignoreModeration], + [props.postsOnly, muted, props.ignoreModeration] ); const mainFeed = useMemo(() => { @@ -60,7 +60,7 @@ const Timeline = (props: TimelineProps) => { (id: u256) => { return (feed.related ?? []).filter(a => findTag(a, "e") === id); }, - [feed.related], + [feed.related] ); const liveStreams = useMemo(() => { return (feed.main ?? []).filter(a => a.kind === EventKind.LiveEvent && findTag(a, "status") === "live"); diff --git a/packages/app/src/Element/TimelineFollows.tsx b/packages/app/src/Element/TimelineFollows.tsx index c9649968..8866a285 100644 --- a/packages/app/src/Element/TimelineFollows.tsx +++ b/packages/app/src/Element/TimelineFollows.tsx @@ -28,11 +28,11 @@ const TimelineFollows = (props: TimelineFollowsProps) => { const [latest, setLatest] = useState(unixNow()); const feed = useSyncExternalStore( cb => FollowsFeed.hook(cb, "*"), - () => FollowsFeed.snapshot(), + () => FollowsFeed.snapshot() ); const reactions = useReactions( "follows-feed-reactions", - feed.map(a => a.id), + feed.map(a => a.id) ); const system = useContext(SnortContext); const login = useLogin(); @@ -48,7 +48,7 @@ const TimelineFollows = (props: TimelineFollowsProps) => { ?.filter(a => (props.postsOnly ? !a.tags.some(b => b[0] === "e") : true)) .filter(a => !isMuted(a.pubkey) && login.follows.item.includes(a.pubkey)); }, - [props.postsOnly, muted, login.follows.timestamp], + [props.postsOnly, muted, login.follows.timestamp] ); const mainFeed = useMemo(() => { @@ -63,7 +63,7 @@ const TimelineFollows = (props: TimelineFollowsProps) => { (id: u256) => { return (reactions?.data ?? []).filter(a => findTag(a, "e") === id); }, - [reactions], + [reactions] ); const liveStreams = useMemo(() => { diff --git a/packages/app/src/Element/ZapstrEmbed.tsx b/packages/app/src/Element/ZapstrEmbed.tsx index fa112e8a..844b5b67 100644 --- a/packages/app/src/Element/ZapstrEmbed.tsx +++ b/packages/app/src/Element/ZapstrEmbed.tsx @@ -17,7 +17,7 @@ export default function ZapstrEmbed({ ev }: { ev: NostrEvent }) { ev.tags.find(a => a[0] === "d")?.[1] ?? "", undefined, ev.kind, - ev.pubkey, + ev.pubkey ); return ( <> diff --git a/packages/app/src/Feed/BadgesFeed.ts b/packages/app/src/Feed/BadgesFeed.ts index d180f160..d6905c5d 100644 --- a/packages/app/src/Feed/BadgesFeed.ts +++ b/packages/app/src/Feed/BadgesFeed.ts @@ -23,7 +23,7 @@ export default function useProfileBadges(pubkey?: HexKey) { if (profileBadges.data) { return chunks( profileBadges.data.tags.filter(t => t[0] === "a" || t[0] === "e"), - 2, + 2 ).reduce((acc, [a, e]) => { return { ...acc, @@ -44,7 +44,7 @@ export default function useProfileBadges(pubkey?: HexKey) { } return acc; }, - { pubkeys: [], ds: [] } as BadgeAwards, + { pubkeys: [], ds: [] } as BadgeAwards ) as BadgeAwards; }, [profile]); @@ -77,7 +77,7 @@ export default function useProfileBadges(pubkey?: HexKey) { }) .filter( ({ award, badge }) => - badge && award.pubkey === badge.pubkey && award.tags.find(t => t[0] === "p" && t[1] === pubkey), + badge && award.pubkey === badge.pubkey && award.tags.find(t => t[0] === "p" && t[1] === pubkey) ) .map(({ badge }) => unwrap(badge)); } diff --git a/packages/app/src/Feed/FeedReactions.ts b/packages/app/src/Feed/FeedReactions.ts index 5faaeb00..cd32b57a 100644 --- a/packages/app/src/Feed/FeedReactions.ts +++ b/packages/app/src/Feed/FeedReactions.ts @@ -13,7 +13,7 @@ export function useReactions(subId: string, ids: Array, others?: (rb: Re .kinds( pref.enableReactions ? [EventKind.Reaction, EventKind.Repost, EventKind.ZapReceipt] - : [EventKind.ZapReceipt, EventKind.Repost], + : [EventKind.ZapReceipt, EventKind.Repost] ) .tag("e", ids); } diff --git a/packages/app/src/Feed/FollowersFeed.ts b/packages/app/src/Feed/FollowersFeed.ts index e8b5c289..84544a29 100644 --- a/packages/app/src/Feed/FollowersFeed.ts +++ b/packages/app/src/Feed/FollowersFeed.ts @@ -14,7 +14,7 @@ export default function useFollowersFeed(pubkey?: HexKey) { const followers = useMemo(() => { const contactLists = followersFeed.data?.filter( - a => a.kind === EventKind.ContactList && a.tags.some(b => b[0] === "p" && b[1] === pubkey), + a => a.kind === EventKind.ContactList && a.tags.some(b => b[0] === "p" && b[1] === pubkey) ); return [...new Set(contactLists?.map(a => a.pubkey))]; }, [followersFeed, pubkey]); diff --git a/packages/app/src/Feed/LoginFeed.ts b/packages/app/src/Feed/LoginFeed.ts index f1eda0d6..8eceb79f 100644 --- a/packages/app/src/Feed/LoginFeed.ts +++ b/packages/app/src/Feed/LoginFeed.ts @@ -85,7 +85,7 @@ export default function useLoginFeed() { Nip4Chats.onEvent(loginFeed.data); const subs = loginFeed.data.filter( - a => a.kind === EventKind.SnortSubscriptions && a.pubkey === bech32ToHex(SnortPubKey), + a => a.kind === EventKind.SnortSubscriptions && a.pubkey === bech32ToHex(SnortPubKey) ); Promise.all( subs.map(async a => { @@ -97,7 +97,7 @@ export default function useLoginFeed() { ...ex, } as SubscriptionEvent; } - }), + }) ).then(a => addSubscription(login, ...a.filter(a => a !== undefined).map(unwrap))); } }, [loginFeed, publisher]); @@ -106,7 +106,7 @@ export default function useLoginFeed() { useEffect(() => { if (loginFeed.data) { const replies = loginFeed.data.filter( - a => a.kind === EventKind.TextNote && !isMuted(a.pubkey) && a.created_at > readNotifications, + a => a.kind === EventKind.TextNote && !isMuted(a.pubkey) && a.created_at > readNotifications ); replies.forEach(async nx => { const n = await makeNotification(nx); diff --git a/packages/app/src/Feed/ThreadFeed.ts b/packages/app/src/Feed/ThreadFeed.ts index 8fe289a2..6603bd2d 100644 --- a/packages/app/src/Feed/ThreadFeed.ts +++ b/packages/app/src/Feed/ThreadFeed.ts @@ -35,11 +35,11 @@ export default function useThreadFeed(link: NostrLink) { .kinds( pref.enableReactions ? [EventKind.Reaction, EventKind.TextNote, EventKind.Repost, EventKind.ZapReceipt] - : [EventKind.TextNote, EventKind.ZapReceipt, EventKind.Repost], + : [EventKind.TextNote, EventKind.ZapReceipt, EventKind.Repost] ) .tag( "e", - allEvents.map(a => a.id), + allEvents.map(a => a.id) ); } if (trackingATags.length > 0) { @@ -50,7 +50,7 @@ export default function useThreadFeed(link: NostrLink) { .authors(parsed.map(a => a[1])) .tag( "d", - parsed.map(a => a[2]), + parsed.map(a => a[2]) ); sub.withFilter().tag("a", trackingATags); } @@ -85,7 +85,7 @@ export default function useThreadFeed(link: NostrLink) { id: b[1], relay: b[2], }; - }), + }) ) .flat(); const eTagsMissing = eTags.filter(a => !mainNotes.some(b => b.id === a.id)); diff --git a/packages/app/src/Feed/TimelineFeed.ts b/packages/app/src/Feed/TimelineFeed.ts index 6feb29da..ea45ede4 100644 --- a/packages/app/src/Feed/TimelineFeed.ts +++ b/packages/app/src/Feed/TimelineFeed.ts @@ -43,7 +43,7 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel .kinds( subject.type === "profile_keyword" ? [EventKind.SetMetadata] - : [EventKind.TextNote, EventKind.Repost, EventKind.Polls], + : [EventKind.TextNote, EventKind.Repost, EventKind.Polls] ); if (subject.relay) { @@ -149,7 +149,7 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel .map(a => unwrap(a)[1]); const repostsByKind1 = main.data .filter( - a => (a.kind === EventKind.Repost || a.kind === EventKind.TextNote) && a.tags.some(tagFilterOfTextRepost(a)), + a => (a.kind === EventKind.Repost || a.kind === EventKind.TextNote) && a.tags.some(tagFilterOfTextRepost(a)) ) .map(a => a.tags.find(tagFilterOfTextRepost(a))) .filter(a => a) diff --git a/packages/app/src/Hooks/useImgProxy.ts b/packages/app/src/Hooks/useImgProxy.ts index 2f1a04cd..090fa4f4 100644 --- a/packages/app/src/Hooks/useImgProxy.ts +++ b/packages/app/src/Hooks/useImgProxy.ts @@ -21,7 +21,7 @@ export default function useImgProxy() { const result = hmacSha256( utils.hexToBytes(unwrap(settings).key), utils.hexToBytes(unwrap(settings).salt), - te.encode(u), + te.encode(u) ); return urlSafe(base64.encode(result)); } diff --git a/packages/app/src/Hooks/useInteractionCache.tsx b/packages/app/src/Hooks/useInteractionCache.tsx index 64cc8122..ab73a99c 100644 --- a/packages/app/src/Hooks/useInteractionCache.tsx +++ b/packages/app/src/Hooks/useInteractionCache.tsx @@ -15,7 +15,7 @@ export function useInteractionCache(pubkey?: HexKey, event?: u256) { const data = useSyncExternalStore( c => InteractionCache.hook(c, id), - () => InteractionCache.snapshot().find(a => a.id === id), + () => InteractionCache.snapshot().find(a => a.id === id) ) || EmptyInteraction; return { data: data, diff --git a/packages/app/src/Hooks/useLogin.tsx b/packages/app/src/Hooks/useLogin.tsx index cf3a205e..b4ffedff 100644 --- a/packages/app/src/Hooks/useLogin.tsx +++ b/packages/app/src/Hooks/useLogin.tsx @@ -4,6 +4,6 @@ import { useSyncExternalStore } from "react"; export default function useLogin() { return useSyncExternalStore( s => LoginStore.hook(s), - () => LoginStore.snapshot(), + () => LoginStore.snapshot() ); } diff --git a/packages/app/src/Login/MultiAccountStore.ts b/packages/app/src/Login/MultiAccountStore.ts index 1b25a66c..3c35ec22 100644 --- a/packages/app/src/Login/MultiAccountStore.ts +++ b/packages/app/src/Login/MultiAccountStore.ts @@ -96,7 +96,7 @@ export class MultiAccountStore extends ExternalStore { type: LoginSessionType, relays?: Record, remoteSignerRelays?: Array, - privateKey?: string, + privateKey?: string ) { if (this.#accounts.has(key)) { throw new Error("Already logged in with this pubkey"); diff --git a/packages/app/src/Nip05/ServiceProvider.ts b/packages/app/src/Nip05/ServiceProvider.ts index eda71371..610d4ed5 100644 --- a/packages/app/src/Nip05/ServiceProvider.ts +++ b/packages/app/src/Nip05/ServiceProvider.ts @@ -97,7 +97,7 @@ export class ServiceProvider { path: string, method?: "GET" | string, body?: unknown, - headers?: { [key: string]: string }, + headers?: { [key: string]: string } ): Promise { try { const rsp = await fetch(`${this.url}${path}`, { diff --git a/packages/app/src/Nip05/SnortServiceProvider.ts b/packages/app/src/Nip05/SnortServiceProvider.ts index f4de626a..d6efa314 100644 --- a/packages/app/src/Nip05/SnortServiceProvider.ts +++ b/packages/app/src/Nip05/SnortServiceProvider.ts @@ -54,7 +54,7 @@ export default class SnortServiceProvider extends ServiceProvider { path: string, method?: "GET" | string, body?: unknown, - headers?: { [key: string]: string }, + headers?: { [key: string]: string } ): Promise { const auth = await this.#publisher.generic(eb => { eb.kind(EventKind.HttpAuthentication); diff --git a/packages/app/src/Pages/ErrorPage.tsx b/packages/app/src/Pages/ErrorPage.tsx index b3fcb541..687c068d 100644 --- a/packages/app/src/Pages/ErrorPage.tsx +++ b/packages/app/src/Pages/ErrorPage.tsx @@ -25,7 +25,7 @@ const ErrorPage = () => { {JSON.stringify( error instanceof Error ? { name: error.name, message: error.message, stack: error.stack } : error, undefined, - " ", + " " )} } diff --git a/packages/app/src/Pages/Layout.tsx b/packages/app/src/Pages/Layout.tsx index a428f941..1df8c604 100644 --- a/packages/app/src/Pages/Layout.tsx +++ b/packages/app/src/Pages/Layout.tsx @@ -89,7 +89,7 @@ export default function Layout() { useEffect(() => { const osTheme = window.matchMedia("(prefers-color-scheme: light)"); setTheme( - preferences.theme === "system" && osTheme.matches ? "light" : preferences.theme === "light" ? "light" : "dark", + preferences.theme === "system" && osTheme.matches ? "light" : preferences.theme === "light" ? "light" : "dark" ); osTheme.onchange = e => { @@ -174,7 +174,7 @@ const AccountHeader = () => { const hasNotifications = useMemo( () => latestNotification > readNotifications, - [latestNotification, readNotifications], + [latestNotification, readNotifications] ); const unreadDms = useMemo(() => (publicKey ? 0 : 0), [publicKey]); diff --git a/packages/app/src/Pages/LoginPage.tsx b/packages/app/src/Pages/LoginPage.tsx index 07401626..ba004d7b 100644 --- a/packages/app/src/Pages/LoginPage.tsx +++ b/packages/app/src/Pages/LoginPage.tsx @@ -55,7 +55,7 @@ const Artwork: Array = [ export async function getNip05PubKey(addr: string): Promise { const [username, domain] = addr.split("@"); const rsp = await fetch( - `https://${domain}/.well-known/nostr.json?name=${encodeURIComponent(username.toLocaleLowerCase())}`, + `https://${domain}/.well-known/nostr.json?name=${encodeURIComponent(username.toLocaleLowerCase())}` ); if (rsp.ok) { const data = await rsp.json(); @@ -103,7 +103,7 @@ export default function LoginPage() { setError( formatMessage({ defaultMessage: "Unknown login error", - }), + }) ); } console.error(e); diff --git a/packages/app/src/Pages/Notifications.tsx b/packages/app/src/Pages/Notifications.tsx index 23cefcd7..7af56025 100644 --- a/packages/app/src/Pages/Notifications.tsx +++ b/packages/app/src/Pages/Notifications.tsx @@ -75,7 +75,7 @@ export default function NotificationsPage() { const notifications = useSyncExternalStore( c => Notifications.hook(c, "*"), - () => Notifications.snapshot(), + () => Notifications.snapshot() ); const timeKey = (ev: NostrEvent) => { @@ -119,7 +119,7 @@ function NotificationGroup({ evs }: { evs: Array }) { return zap.anonZap ? "anon" : zap.sender ?? a.pubkey; } return a.pubkey; - }), + }) ); const firstPubkey = pubkeys[0]; const firstPubkeyProfile = useUserProfile(inView ? (firstPubkey === "anon" ? "" : firstPubkey) : ""); @@ -213,7 +213,7 @@ function NotificationGroup({ evs }: { evs: Array }) { pubkeys.length - 1, firstPubkey === "anon" ? formatMessage({ defaultMessage: "Anon" }) - : getDisplayName(firstPubkeyProfile, firstPubkey), + : getDisplayName(firstPubkeyProfile, firstPubkey) )} )} diff --git a/packages/app/src/Pages/ProfilePage.tsx b/packages/app/src/Pages/ProfilePage.tsx index b5655eec..434b816b 100644 --- a/packages/app/src/Pages/ProfilePage.tsx +++ b/packages/app/src/Pages/ProfilePage.tsx @@ -221,7 +221,7 @@ export default function ProfilePage() { } as { [key: string]: Tab }; const [tab, setTab] = useState(ProfileTab.Notes); const optionalTabs = [ProfileTab.Zaps, ProfileTab.Relays, ProfileTab.Bookmarks, ProfileTab.Muted].filter(a => - unwrap(a), + unwrap(a) ) as Tab[]; const horizontalScroll = useHorizontalScroll(); @@ -433,7 +433,7 @@ export default function ProfilePage() { type: TLVEntryType.Author, length: 64, value: id, - })}`, + })}` ) }> diff --git a/packages/app/src/Pages/ZapPool.tsx b/packages/app/src/Pages/ZapPool.tsx index 26664371..f6703ee3 100644 --- a/packages/app/src/Pages/ZapPool.tsx +++ b/packages/app/src/Pages/ZapPool.tsx @@ -73,7 +73,7 @@ export default function ZapPoolPage() { const login = useLogin(); const zapPool = useSyncExternalStore( c => ZapPoolController.hook(c), - () => ZapPoolController.snapshot(), + () => ZapPoolController.snapshot() ); const { wallet } = useWallet(); diff --git a/packages/app/src/Pages/settings/Accounts.tsx b/packages/app/src/Pages/settings/Accounts.tsx index ce113010..9ad66696 100644 --- a/packages/app/src/Pages/settings/Accounts.tsx +++ b/packages/app/src/Pages/settings/Accounts.tsx @@ -27,7 +27,7 @@ export default function AccountsPage() { setError( formatMessage({ defaultMessage: "Unknown login error", - }), + }) ); } console.error(e); diff --git a/packages/app/src/Pages/settings/handle/LNAddress.tsx b/packages/app/src/Pages/settings/handle/LNAddress.tsx index 0cad952a..562dc571 100644 --- a/packages/app/src/Pages/settings/handle/LNAddress.tsx +++ b/packages/app/src/Pages/settings/handle/LNAddress.tsx @@ -29,7 +29,7 @@ export default function LNForwardAddress({ handle }: { handle: ManageHandle }) { setError( formatMessage({ defaultMessage: "Invalid LNURL", - }), + }) ); return; } diff --git a/packages/app/src/Pages/settings/wallet/Cashu.tsx b/packages/app/src/Pages/settings/wallet/Cashu.tsx index e1a6d411..5a2f4efa 100644 --- a/packages/app/src/Pages/settings/wallet/Cashu.tsx +++ b/packages/app/src/Pages/settings/wallet/Cashu.tsx @@ -39,7 +39,7 @@ const ConnectCashu = () => { setError( formatMessage({ defaultMessage: "Unknown error", - }), + }) ); } } diff --git a/packages/app/src/Pages/settings/wallet/LNC.tsx b/packages/app/src/Pages/settings/wallet/LNC.tsx index 64c66d21..d33fa9fe 100644 --- a/packages/app/src/Pages/settings/wallet/LNC.tsx +++ b/packages/app/src/Pages/settings/wallet/LNC.tsx @@ -32,7 +32,7 @@ const ConnectLNC = () => { setError( formatMessage({ defaultMessage: "Unknown error", - }), + }) ); } } diff --git a/packages/app/src/Pages/settings/wallet/LNDHub.tsx b/packages/app/src/Pages/settings/wallet/LNDHub.tsx index d2c20f44..b33462ec 100644 --- a/packages/app/src/Pages/settings/wallet/LNDHub.tsx +++ b/packages/app/src/Pages/settings/wallet/LNDHub.tsx @@ -37,7 +37,7 @@ const ConnectLNDHub = () => { setError( formatMessage({ defaultMessage: "Unknown error", - }), + }) ); } } diff --git a/packages/app/src/Pages/settings/wallet/NWC.tsx b/packages/app/src/Pages/settings/wallet/NWC.tsx index 41419615..921d6c59 100644 --- a/packages/app/src/Pages/settings/wallet/NWC.tsx +++ b/packages/app/src/Pages/settings/wallet/NWC.tsx @@ -37,7 +37,7 @@ const ConnectNostrWallet = () => { setError( formatMessage({ defaultMessage: "Unknown error", - }), + }) ); } } diff --git a/packages/app/src/SnortApi.ts b/packages/app/src/SnortApi.ts index f29a529e..a69f71e6 100644 --- a/packages/app/src/SnortApi.ts +++ b/packages/app/src/SnortApi.ts @@ -88,7 +88,7 @@ export default class SnortApi { path: string, method?: "GET" | string, body?: { [key: string]: string }, - headers?: { [key: string]: string }, + headers?: { [key: string]: string } ): Promise { if (!this.#publisher) { throw new Error("Publisher not set"); @@ -110,7 +110,7 @@ export default class SnortApi { path: string, method?: "GET" | string, body?: { [key: string]: string }, - headers?: { [key: string]: string }, + headers?: { [key: string]: string } ): Promise { const rsp = await fetch(`${this.#url}${path}`, { method: method, diff --git a/packages/app/src/SnortUtils/index.ts b/packages/app/src/SnortUtils/index.ts index 65062b2a..242b516f 100644 --- a/packages/app/src/SnortUtils/index.ts +++ b/packages/app/src/SnortUtils/index.ts @@ -50,7 +50,7 @@ export async function openFile(): Promise { } }, 300); }, - { once: true }, + { once: true } ); }); } @@ -209,7 +209,7 @@ export function dedupeByPubkey(events: TaggedNostrEvent[]) { list: [...list, ev], }; }, - { list: [], seen: new Set([]) }, + { list: [], seen: new Set([]) } ); return deduped.list as TaggedNostrEvent[]; } @@ -226,7 +226,7 @@ export function dedupeById(events: Array) { list: [...list, ev], }; }, - { list: [], seen: new Set([]) }, + { list: [], seen: new Set([]) } ); return deduped.list as Array; } @@ -487,7 +487,7 @@ export function kvToObject(o: string, sep?: string) { return [match[1], match[2]]; } return []; - }), + }) ) as T; } diff --git a/packages/app/src/Toaster.tsx b/packages/app/src/Toaster.tsx index 1d45a177..eecb85ca 100644 --- a/packages/app/src/Toaster.tsx +++ b/packages/app/src/Toaster.tsx @@ -39,7 +39,7 @@ export const Toastore = new ToasterSlots(); export default function Toaster() { const toast = useSyncExternalStore( c => Toastore.hook(c), - () => Toastore.snapshot(), + () => Toastore.snapshot() ); return ( diff --git a/packages/app/src/Upload/VoidCat.ts b/packages/app/src/Upload/VoidCat.ts index 0fe5e010..8eb8a11a 100644 --- a/packages/app/src/Upload/VoidCat.ts +++ b/packages/app/src/Upload/VoidCat.ts @@ -12,7 +12,7 @@ import { magnetURIDecode } from "SnortUtils"; export default async function VoidCatUpload( file: File | Blob, filename: string, - publisher?: EventPublisher, + publisher?: EventPublisher ): Promise { const api = new VoidApi(VoidCatHost); const uploader = api.getUploader(file); diff --git a/packages/app/src/Wallet/Cashu.ts b/packages/app/src/Wallet/Cashu.ts index b88dc13c..541e65ba 100644 --- a/packages/app/src/Wallet/Cashu.ts +++ b/packages/app/src/Wallet/Cashu.ts @@ -57,6 +57,6 @@ export interface NutStashBackup { mints: [ { mintURL: string; - }, + } ]; } diff --git a/packages/app/src/Wallet/LNCWallet.ts b/packages/app/src/Wallet/LNCWallet.ts index 6093289e..342dfec8 100644 --- a/packages/app/src/Wallet/LNCWallet.ts +++ b/packages/app/src/Wallet/LNCWallet.ts @@ -126,7 +126,7 @@ export class LNCWallet implements LNWallet { err => { this.#log(err); reject(err); - }, + } ); }); } diff --git a/packages/app/src/Wallet/NostrWalletConnect.ts b/packages/app/src/Wallet/NostrWalletConnect.ts index 5930e60d..d2d1113d 100644 --- a/packages/app/src/Wallet/NostrWalletConnect.ts +++ b/packages/app/src/Wallet/NostrWalletConnect.ts @@ -182,7 +182,7 @@ export class NostrConnectWallet implements LNWallet { ], () => { // ignored - }, + } ); await this.#conn.SendAsync(evCommand); return await new Promise((resolve, reject) => { diff --git a/packages/app/src/Wallet/WebLN.ts b/packages/app/src/Wallet/WebLN.ts index 68db4212..e9708277 100644 --- a/packages/app/src/Wallet/WebLN.ts +++ b/packages/app/src/Wallet/WebLN.ts @@ -84,7 +84,7 @@ export class WebLNWallet implements LNWallet { await window.webln?.makeInvoice({ amount: req.amount, defaultMemo: req.memo, - }), + }) ); if (rsp) { const invoice = prToWalletInvoice(rsp.paymentRequest); diff --git a/packages/app/src/Wallet/index.ts b/packages/app/src/Wallet/index.ts index cb5b98e0..ad8a01dd 100644 --- a/packages/app/src/Wallet/index.ts +++ b/packages/app/src/Wallet/index.ts @@ -248,7 +248,7 @@ window.document.addEventListener("close", () => { export function useWallet() { const wallet = useSyncExternalStore( h => Wallets.hook(h), - () => Wallets.snapshot(), + () => Wallets.snapshot() ); useEffect(() => { if (wallet.wallet?.isReady() === false && wallet.wallet.canAutoLogin()) { diff --git a/packages/app/src/ZapPoolController.ts b/packages/app/src/ZapPoolController.ts index 617933bc..0695b5d7 100644 --- a/packages/app/src/ZapPoolController.ts +++ b/packages/app/src/ZapPoolController.ts @@ -54,7 +54,7 @@ class ZapPool extends ExternalStore> { Toastore.push({ element: `Sent ${amtSend.toLocaleString()} sats to ${getDisplayName( profile, - x.pubkey, + x.pubkey )} from your zap pool`, expire: unixNow() + 10, icon: "zap", diff --git a/packages/app/src/chat/index.ts b/packages/app/src/chat/index.ts index d6b9326a..f29f9122 100644 --- a/packages/app/src/chat/index.ts +++ b/packages/app/src/chat/index.ts @@ -116,7 +116,7 @@ export function createChatLink(type: ChatType, ...params: Array) { type: TLVEntryType.Author, length: params[0].length, value: params[0], - } as TLVEntry, + } as TLVEntry )}`; } case ChatType.PrivateDirectMessage: { @@ -127,7 +127,7 @@ export function createChatLink(type: ChatType, ...params: Array) { type: TLVEntryType.Author, length: params[0].length, value: params[0], - } as TLVEntry, + } as TLVEntry )}`; } case ChatType.PrivateGroupChat: { @@ -139,8 +139,8 @@ export function createChatLink(type: ChatType, ...params: Array) { type: TLVEntryType.Author, length: a.length, value: a, - }) as TLVEntry, - ), + } as TLVEntry) + ) )}`; } } @@ -161,14 +161,14 @@ export function useNip4Chat() { const { publicKey } = useLogin(); return useSyncExternalStore( c => Nip4Chats.hook(c), - () => Nip4Chats.snapshot(publicKey), + () => Nip4Chats.snapshot(publicKey) ); } export function useNip29Chat() { return useSyncExternalStore( c => Nip29Chats.hook(c), - () => Nip29Chats.snapshot(), + () => Nip29Chats.snapshot() ); } @@ -176,7 +176,7 @@ export function useNip24Chat() { const { publicKey } = useLogin(); return useSyncExternalStore( c => Nip24Chats.hook(c), - () => Nip24Chats.snapshot(publicKey), + () => Nip24Chats.snapshot(publicKey) ); } diff --git a/packages/app/src/chat/nip24.ts b/packages/app/src/chat/nip24.ts index 6281a6b7..9344e6fb 100644 --- a/packages/app/src/chat/nip24.ts +++ b/packages/app/src/chat/nip24.ts @@ -39,8 +39,8 @@ export class Nip24ChatSystem extends ExternalStore> implements ChatS value: v, type: TLVEntryType.Author, length: v.length, - }) as TLVEntry, - ), + } as TLVEntry) + ) ); }; return dedupe(messages.map(a => chatId(a))).map(a => { @@ -72,7 +72,7 @@ export class Nip24ChatSystem extends ExternalStore> implements ChatS } as { t: number; title: string | undefined; - }, + } ); return { type: ChatType.PrivateDirectMessage, diff --git a/packages/app/src/chat/nip29.ts b/packages/app/src/chat/nip29.ts index 261f7e86..956472e7 100644 --- a/packages/app/src/chat/nip29.ts +++ b/packages/app/src/chat/nip29.ts @@ -46,12 +46,12 @@ export class Nip29ChatSystem extends ExternalStore> implements ChatS .map(a => a.tags.find(b => b[0] === "g")) .filter(a => a !== undefined) .map(a => unwrap(a)) - .map(a => `${a[2]}${a[1]}`), + .map(a => `${a[2]}${a[1]}`) ); return groups.map(g => { const [relay, channel] = g.split("/", 2); const messages = allMessages.filter( - a => `${a.tags.find(b => b[0] === "g")?.[2]}${a.tags.find(b => b[0] === "g")?.[1]}` === g, + a => `${a.tags.find(b => b[0] === "g")?.[2]}${a.tags.find(b => b[0] === "g")?.[1]}` === g ); const lastRead = lastReadInChat(g); return { diff --git a/packages/app/src/chat/nip4.ts b/packages/app/src/chat/nip4.ts index f011d575..c766ba5a 100644 --- a/packages/app/src/chat/nip4.ts +++ b/packages/app/src/chat/nip4.ts @@ -34,7 +34,7 @@ export class Nip4ChatSystem extends ExternalStore> implements ChatSy const dms = this.#cache.snapshot(); const dmSince = dms.reduce( (acc, v) => (v.created_at > acc && v.kind === EventKind.DirectMessage ? (acc = v.created_at) : acc), - 0, + 0 ); this.#log("Loading DMS since %s", new Date(dmSince * 1000)); @@ -49,15 +49,12 @@ export class Nip4ChatSystem extends ExternalStore> implements ChatSy listChats(pk: string): Chat[] { const myDms = this.#nip4Events(); - const chats = myDms.reduce( - (acc, v) => { - const chatId = inChatWith(v, pk); - acc[chatId] ??= []; - acc[chatId].push(v); - return acc; - }, - {} as Record>, - ); + const chats = myDms.reduce((acc, v) => { + const chatId = inChatWith(v, pk); + acc[chatId] ??= []; + acc[chatId].push(v); + return acc; + }, {} as Record>); return [...Object.entries(chats)].map(([k, v]) => Nip4ChatSystem.createChatObj(k, v)); } diff --git a/packages/app/src/index.tsx b/packages/app/src/index.tsx index f434fa44..7666afb0 100644 --- a/packages/app/src/index.tsx +++ b/packages/app/src/index.tsx @@ -173,5 +173,5 @@ root.render( - , + );