From 4e7e856b95b6afd35a670d1a792655cca6f1a6e3 Mon Sep 17 00:00:00 2001 From: hzrd149 Date: Sun, 1 Dec 2024 20:03:26 -0600 Subject: [PATCH] code cleanup --- package.json | 4 +-- src/classes/chunked-request.ts | 2 +- src/classes/pubkey-graph.ts | 4 +-- src/classes/relay-pool.ts | 14 ++++---- src/classes/webrtc/nostr-webrtc-peer.tsx | 2 +- src/classes/webrtc/webrtc-relay-server.ts | 2 +- src/components/content/links/youtube.tsx | 4 +-- src/components/debug-modal/pages/cache.tsx | 2 +- src/components/layout/ghost/timeline.tsx | 12 ++++--- src/components/magic-textarea.tsx | 2 ++ .../generic-note-timeline/timeline-item.tsx | 1 - .../timeline-page/media-timeline/index.tsx | 4 +-- src/components/user/user-follow-button.tsx | 4 +-- src/helpers/lightning.ts | 4 +-- src/helpers/nostr/event.ts | 2 +- src/helpers/nostr/mailbox.ts | 6 ++-- src/helpers/nostr/zaps.ts | 12 +++---- src/helpers/qrcode.ts | 2 +- src/helpers/relay.ts | 2 +- src/hooks/timeline/use-number-cache.ts | 2 +- src/lib/open-graph-scraper/media.ts | 4 +-- src/lib/qrcodegen.ts | 32 +++++++++---------- .../global/notifications-provider.tsx | 2 +- src/providers/global/publish-provider.tsx | 2 +- .../global/web-of-trust-provider.tsx | 2 +- .../route/require-current-account.tsx | 2 +- src/queries/trusted-mints.ts | 2 +- src/services/account.ts | 2 +- src/services/channel-metadata.ts | 2 +- src/services/decryption-cache.ts | 2 +- src/services/dictionary.ts | 2 +- src/services/dns-identity.ts | 2 +- src/services/event-count.ts | 2 +- src/services/event-reactions.ts | 2 +- src/services/event-store.ts | 4 +-- src/services/event-zaps.ts | 2 +- src/services/local-relay.ts | 4 +-- src/services/local-settings.ts | 2 +- src/services/page-api.ts | 2 +- src/services/process-manager.ts | 2 +- src/services/read-status.ts | 2 +- src/services/relay-pool.ts | 2 +- src/services/relay-scoreboard.ts | 2 +- src/services/relay-stats.ts | 2 +- src/services/replaceable-events.ts | 2 +- src/services/username-search.ts | 2 +- .../components/community-mod-list.tsx | 2 +- .../horizonal-community-details.tsx | 4 +-- .../components/vertical-community-details.tsx | 4 +-- .../discovery/dvm-feed/components/feed.tsx | 3 +- src/views/goals/components/goal-contents.tsx | 2 +- src/views/link/index.tsx | 2 +- src/views/lists/list/index.tsx | 4 +-- src/views/relays/browse-sets.tsx | 2 +- src/views/relays/media-servers/index.tsx | 2 +- src/views/relays/relay/relay-details.tsx | 2 +- src/views/search/index.tsx | 2 +- src/views/signin/address/index.tsx | 2 +- src/views/signin/nostr-connect.tsx | 4 +-- .../processes/process/process-icon.tsx | 2 +- .../thread/components/tabs/tools/summary.tsx | 4 +-- src/views/tools/event-console/index.tsx | 2 +- .../tools/event-console/user-autocomplete.ts | 6 ++-- src/views/tools/event-publisher/index.tsx | 4 ++- .../transform-note/translation/index.tsx | 2 +- .../torrents/components/torrent-table-row.tsx | 2 +- src/views/torrents/new.tsx | 2 +- src/views/tracks/components/track-player.tsx | 2 +- src/views/user/components/user-zap-button.tsx | 2 +- src/views/videos/components/video-card.tsx | 5 ++- 70 files changed, 125 insertions(+), 118 deletions(-) diff --git a/package.json b/package.json index 25ed6d01c..ac7b161e1 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,9 @@ "start": "vite serve", "dev": "VITE_APP_VERSION=dev vite serve", "build": "tsc --project tsconfig.json && vite build", - "format": "prettier --ignore-path .prettierignore -w .", + "build-icons": "node ./scripts/build-icons.mjs", "analyze": "pnpm dlx vite-bundle-visualizer -o ./stats.html", - "build-icons": "node ./scripts/build-icons.mjs" + "format": "prettier --ignore-path .prettierignore -w ." }, "dependencies": { "@cashu/cashu-ts": "2.0.0-rc1", diff --git a/src/classes/chunked-request.ts b/src/classes/chunked-request.ts index 48e9a3cb4..27d49353f 100644 --- a/src/classes/chunked-request.ts +++ b/src/classes/chunked-request.ts @@ -73,7 +73,7 @@ export default class ChunkedRequest { } let filters: Filter[] = mergeFilter(this.filters, { limit: this.chunkSize }); - let oldestEvent = this.getLastEvent(); + const oldestEvent = this.getLastEvent(); if (oldestEvent) { filters = mergeFilter(filters, { until: oldestEvent.created_at - 1 }); } diff --git a/src/classes/pubkey-graph.ts b/src/classes/pubkey-graph.ts index c5c4a5744..1268530c3 100644 --- a/src/classes/pubkey-graph.ts +++ b/src/classes/pubkey-graph.ts @@ -108,7 +108,7 @@ export class PubkeyGraph extends EventEmitter { const refCount = new Map(); const walkLevel = (level = 0) => { if (next.size === 0) return; - let keys = new Set(next); + const keys = new Set(next); next.clear(); for (const key of keys) { @@ -141,7 +141,7 @@ export class PubkeyGraph extends EventEmitter { } getPaths(pubkey: string, maxLength = 2) { - let paths: string[][] = []; + const paths: string[][] = []; const walk = (p: string, maxLvl = 0, path: string[] = []) => { if (path.includes(p)) return; diff --git a/src/classes/relay-pool.ts b/src/classes/relay-pool.ts index 5dfc82ac4..2ded711a5 100644 --- a/src/classes/relay-pool.ts +++ b/src/classes/relay-pool.ts @@ -106,7 +106,7 @@ export default class RelayPool implements IConnectionPool { } async waitForOpen(relayOrUrl: string | URL | AbstractRelay, quite = true) { - let relay = this.getRelay(relayOrUrl); + const relay = this.getRelay(relayOrUrl); if (!relay) return Promise.reject("Missing relay"); if (relay.connected) return true; @@ -123,7 +123,7 @@ export default class RelayPool implements IConnectionPool { } async requestConnect(relayOrUrl: string | URL | AbstractRelay, quite = true) { - let relay = this.getRelay(relayOrUrl); + const relay = this.getRelay(relayOrUrl); if (!relay) return; if (!relay.connected && !offlineMode.value) { @@ -144,11 +144,11 @@ export default class RelayPool implements IConnectionPool { } getRelayAuthStorageKey(relayOrUrl: string | URL | AbstractRelay) { - let relay = this.getRelay(relayOrUrl); + const relay = this.getRelay(relayOrUrl); return `${relay!.url}-auth-mode`; } getRelayAuthMode(relayOrUrl: string | URL | AbstractRelay): RelayAuthMode | undefined { - let relay = this.getRelay(relayOrUrl); + const relay = this.getRelay(relayOrUrl); if (!relay) return; const defaultMode = localSettings.defaultAuthenticationMode.value; @@ -157,7 +157,7 @@ export default class RelayPool implements IConnectionPool { return mode || defaultMode; } setRelayAuthMode(relayOrUrl: string | URL | AbstractRelay, mode: RelayAuthMode) { - let relay = this.getRelay(relayOrUrl); + const relay = this.getRelay(relayOrUrl); if (!relay) return; localStorage.setItem(this.getRelayAuthStorageKey(relay), mode); @@ -169,7 +169,7 @@ export default class RelayPool implements IConnectionPool { sign: Parameters[0], quite = true, ) { - let relay = this.getRelay(relayOrUrl); + const relay = this.getRelay(relayOrUrl); if (!relay) return; const pending = this.pendingAuth.get(relay); @@ -204,7 +204,7 @@ export default class RelayPool implements IConnectionPool { } canSubscribe(relayOrUrl: string | URL | AbstractRelay) { - let relay = this.getRelay(relayOrUrl); + const relay = this.getRelay(relayOrUrl); if (!relay) return false; return this.authForSubscribe.get(relay).value !== false; diff --git a/src/classes/webrtc/nostr-webrtc-peer.tsx b/src/classes/webrtc/nostr-webrtc-peer.tsx index 79ce3d5b5..a5cb9b0a1 100644 --- a/src/classes/webrtc/nostr-webrtc-peer.tsx +++ b/src/classes/webrtc/nostr-webrtc-peer.tsx @@ -270,7 +270,7 @@ export default class NostrWebRTCPeer extends EventEmitter { this.log(`Got ${candidates.length} candidates`); - for (let candidate of candidates) { + for (const candidate of candidates) { await pc.addIceCandidate(candidate); } } diff --git a/src/classes/webrtc/webrtc-relay-server.ts b/src/classes/webrtc/webrtc-relay-server.ts index ea30484f8..4d773cd7a 100644 --- a/src/classes/webrtc/webrtc-relay-server.ts +++ b/src/classes/webrtc/webrtc-relay-server.ts @@ -90,7 +90,7 @@ export default class WebRtcRelayServer extends EventEmitter { handleCloseMessage(data: any[]) { const [_, id] = data as [string, string, ...Filter[]]; - let sub = this.subscriptions.get(id); + const sub = this.subscriptions.get(id); if (sub) { sub.close(); this.subscriptions.delete(id); diff --git a/src/components/content/links/youtube.tsx b/src/components/content/links/youtube.tsx index 9b6100370..0133c57cb 100644 --- a/src/components/content/links/youtube.tsx +++ b/src/components/content/links/youtube.tsx @@ -49,7 +49,7 @@ export function renderYoutubePlaylistURL(match: URL) { function YoutubeVideoEmbed({ url }: { url: URL }) { const { youtubeRedirect } = useAppSettings(); - var videoId = url.searchParams.get("v"); + let videoId = url.searchParams.get("v"); if (url.hostname === "youtu.be") videoId = url.pathname.split("/")[1]; if (!videoId) return null; @@ -74,7 +74,7 @@ export function renderYoutubeVideoURL(match: URL) { if (!YOUTUBE_DOMAINS.includes(match.hostname)) return null; if (match.pathname.startsWith("/live")) return null; - var videoId = match.searchParams.get("v"); + let videoId = match.searchParams.get("v"); if (match.hostname === "youtu.be") videoId = match.pathname.split("/")[1]; if (!videoId) return null; diff --git a/src/components/debug-modal/pages/cache.tsx b/src/components/debug-modal/pages/cache.tsx index bb0185700..b1e3f74df 100644 --- a/src/components/debug-modal/pages/cache.tsx +++ b/src/components/debug-modal/pages/cache.tsx @@ -10,7 +10,7 @@ export default function DebugEventCachePage({ event }: { event: NostrEvent }) { const update = () => eventStore.update(event); const renderValue = (field: symbol) => { - let value = Reflect.get(event, field); + const value = Reflect.get(event, field); if (value instanceof Map) return JSON.stringify(Object.fromEntries(value.entries())); if (value instanceof Set) return JSON.stringify(Array.from(value)); diff --git a/src/components/layout/ghost/timeline.tsx b/src/components/layout/ghost/timeline.tsx index 64c0b4a0e..c9e5a369b 100644 --- a/src/components/layout/ghost/timeline.tsx +++ b/src/components/layout/ghost/timeline.tsx @@ -44,7 +44,7 @@ function TimelineItem({ event }: { event: NostrEvent }) { const renderContent = () => { switch (event.kind) { - case kinds.EncryptedDirectMessage: + case kinds.EncryptedDirectMessage: { const sender = getDMSender(event); const recipient = getDMRecipient(event); return ( @@ -52,13 +52,15 @@ function TimelineItem({ event }: { event: NostrEvent }) { messaged ); - case kinds.Contacts: + } + case kinds.Contacts: { return ( Updated contacts ); - case kinds.Reaction: + } + case kinds.Reaction: { const pointer = nip25.getReactedEventPointer(event); return ( ); - default: + } + default: { return ( {event.content} ); + } } }; diff --git a/src/components/magic-textarea.tsx b/src/components/magic-textarea.tsx index acaa35ece..d434342d9 100644 --- a/src/components/magic-textarea.tsx +++ b/src/components/magic-textarea.tsx @@ -135,4 +135,6 @@ const MagicTextArea = forwardRef { - var images: PhotoWithEvent[] = []; + const images: PhotoWithEvent[] = []; for (const event of timeline) { if (event.kind === kinds.Repost || event.kind === kinds.GenericRepost) continue; const urls = event.content.matchAll(getMatchLink()); - let i = 0; + const i = 0; for (const match of urls) { if (isImageURL(match[0])) images.push({ event, src: match[0] }); } diff --git a/src/components/user/user-follow-button.tsx b/src/components/user/user-follow-button.tsx index 5320594a5..5ed356221 100644 --- a/src/components/user/user-follow-button.tsx +++ b/src/components/user/user-follow-button.tsx @@ -121,14 +121,14 @@ export function UserFollowButton({ pubkey, showLists, ...props }: UserFollowButt const signed = await requestSignature(draft); await publish("Follow", signed); setLoading(false); - }, [contacts, requestSignature]); + }, [contacts, requestSignature, pubkey, publish]); const handleUnfollow = useAsyncErrorHandler(async () => { setLoading(true); const draft = listRemovePerson(contacts || createEmptyContactList(), pubkey); const signed = await requestSignature(draft); await publish("Unfollow", signed); setLoading(false); - }, [contacts, requestSignature]); + }, [contacts, requestSignature, pubkey, publish]); if (showLists) { return ( diff --git a/src/helpers/lightning.ts b/src/helpers/lightning.ts index 3cca4a726..5381423ca 100644 --- a/src/helpers/lightning.ts +++ b/src/helpers/lightning.ts @@ -1,7 +1,7 @@ // based on https://stackoverflow.com/a/10469752 export function humanReadableSats(sats: number) { if (sats === 0) return "0"; - var s = ["", "K", "M"]; - var e = Math.floor(Math.log(sats) / Math.log(1000)); + const s = ["", "K", "M"]; + const e = Math.floor(Math.log(sats) / Math.log(1000)); return Math.round((sats / Math.pow(1000, e)) * 100) / 100 + s[e]; } diff --git a/src/helpers/nostr/event.ts b/src/helpers/nostr/event.ts index fc1107fc4..99915b9b9 100644 --- a/src/helpers/nostr/event.ts +++ b/src/helpers/nostr/event.ts @@ -115,7 +115,7 @@ export function getContentTagRefs(content: string, tags: Tag[]) { break; } - let matchingTags = tags.filter((t) => t[0] === type && t[1] === id); + const matchingTags = tags.filter((t) => t[0] === type && t[1] === id); for (const t of matchingTags) foundTags.add(t); } diff --git a/src/helpers/nostr/mailbox.ts b/src/helpers/nostr/mailbox.ts index 6c3e2aac0..81effad97 100644 --- a/src/helpers/nostr/mailbox.ts +++ b/src/helpers/nostr/mailbox.ts @@ -6,7 +6,7 @@ import { cloneEvent } from "./event"; /** fixes or removes any bad r tags */ export function cleanRTags(tags: Tag[]) { - let newTags: Tag[] = []; + const newTags: Tag[] = []; for (const tag of tags) { if (tag[0] === "r") { if (!tag[1]) continue; @@ -39,7 +39,7 @@ export function getRelaysFromMailbox(list: NostrEvent | DraftNostrEvent): { url: } export function addRelayModeToMailbox(list: NostrEvent | undefined, relay: string, mode: RelayMode): DraftNostrEvent { - let draft = cloneEvent(kinds.RelayList, list); + const draft = cloneEvent(kinds.RelayList, list); draft.tags = cleanRTags(draft.tags); const existing = draft.tags.find((t) => t[0] === "r" && t[1] === relay) as RTag; @@ -54,7 +54,7 @@ export function removeRelayModeFromMailbox( relay: string, mode: RelayMode, ): DraftNostrEvent { - let draft = cloneEvent(kinds.RelayList, list); + const draft = cloneEvent(kinds.RelayList, list); draft.tags = cleanRTags(draft.tags); const existing = draft.tags.find((t) => t[0] === "r" && t[1] === relay) as RTag; diff --git a/src/helpers/nostr/zaps.ts b/src/helpers/nostr/zaps.ts index bca7090e8..7c28b2d62 100644 --- a/src/helpers/nostr/zaps.ts +++ b/src/helpers/nostr/zaps.ts @@ -6,20 +6,20 @@ import { getZapPayment, isETag, isPTag, ProfileContent } from "applesauce-core/h export async function getZapEndpoint(metadata: ProfileContent): Promise { try { let lnurl: string = ""; - let { lud06, lud16 } = metadata; + const { lud06, lud16 } = metadata; if (lud06) { - let { words } = bech32.decode(lud06 as `${string}1${string}`, 1000); - let data = bech32.fromWords(words); + const { words } = bech32.decode(lud06 as `${string}1${string}`, 1000); + const data = bech32.fromWords(words); lnurl = utils.utf8Decoder.decode(data); } else if (lud16) { - let [name, domain] = lud16.split("@"); + const [name, domain] = lud16.split("@"); lnurl = `https://${domain}/.well-known/lnurlp/${name}`; } else { return null; } - let res = await fetch(lnurl); - let body = await res.json(); + const res = await fetch(lnurl); + const body = await res.json(); if (body.allowsNostr && body.nostrPubkey) { return body.callback; diff --git a/src/helpers/qrcode.ts b/src/helpers/qrcode.ts index 2d148cd69..ac07f4e66 100644 --- a/src/helpers/qrcode.ts +++ b/src/helpers/qrcode.ts @@ -2,7 +2,7 @@ import { QrCode } from "../lib/qrcodegen"; export function drawSvgPath(qr: QrCode, border: number): string { if (border < 0) throw new RangeError("Border must be non-negative"); - let parts: Array = []; + const parts: Array = []; for (let y = 0; y < qr.size; y++) { for (let x = 0; x < qr.size; x++) { if (qr.getModule(x, y)) parts.push(`M${x + border},${y + border}h1v1h-1z`); diff --git a/src/helpers/relay.ts b/src/helpers/relay.ts index 5c7684129..d3632cbf1 100644 --- a/src/helpers/relay.ts +++ b/src/helpers/relay.ts @@ -151,7 +151,7 @@ export function subscribeMany(relays: string[], filters: Filter[], params: Subsc return; } - let subscription = relay.subscribe(filters, { + const subscription = relay.subscribe(filters, { ...params, oneose: () => handleEose(i), onclose: (reason) => handleClose(i, reason), diff --git a/src/hooks/timeline/use-number-cache.ts b/src/hooks/timeline/use-number-cache.ts index 4a162fbd0..ac0a3aa25 100644 --- a/src/hooks/timeline/use-number-cache.ts +++ b/src/hooks/timeline/use-number-cache.ts @@ -12,7 +12,7 @@ export type NumberCache = { export default function useNumberCache(cacheKey: string): NumberCache { const get = useCallback( (key: string) => { - let map = cache.get(cacheKey); + const map = cache.get(cacheKey); if (!map) return undefined; return map.get(key); diff --git a/src/lib/open-graph-scraper/media.ts b/src/lib/open-graph-scraper/media.ts index 3f49e5688..88b100901 100644 --- a/src/lib/open-graph-scraper/media.ts +++ b/src/lib/open-graph-scraper/media.ts @@ -99,7 +99,7 @@ export function mediaSetup(ogObject: OgObjectInteral) { ogObject.ogImageURL = ogObject.ogImageURL ? ogObject.ogImageURL : []; ogObject.ogImageProperty = ogObject.ogImageProperty ? ogObject.ogImageProperty : []; // set ogImageProperty to ogImageSecureURL if it exists - // eslint-disable-next-line max-len + ogObject.ogImageProperty = ogObject.ogImageSecureURL.length !== 0 ? ogObject.ogImageSecureURL : ogObject.ogImageProperty; // fall back to ogImageURL if ogImageProperty isn't set @@ -150,7 +150,7 @@ export function mediaSetup(ogObject: OgObjectInteral) { ogObject.twitterImageAlt ) { ogObject.twitterImageSrc = ogObject.twitterImageSrc ? ogObject.twitterImageSrc : []; - // eslint-disable-next-line max-len + ogObject.twitterImageProperty = ogObject.twitterImageProperty ? ogObject.twitterImageProperty : ogObject.twitterImageSrc; // deafult to twitterImageSrc diff --git a/src/lib/qrcodegen.ts b/src/lib/qrcodegen.ts index dc034faed..2ae0b07b6 100644 --- a/src/lib/qrcodegen.ts +++ b/src/lib/qrcodegen.ts @@ -114,7 +114,7 @@ export class QrCode { } // Concatenate all segments to create the data bit string - let bb: Array = []; + const bb: Array = []; for (const seg of segs) { appendBits(seg.mode.modeBits, 4, bb); appendBits(seg.numChars, seg.mode.numCharCountBits(version), bb); @@ -133,7 +133,7 @@ export class QrCode { for (let padByte = 0xec; bb.length < dataCapacityBits; padByte ^= 0xec ^ 0x11) appendBits(padByte, 8, bb); // Pack bits into bytes in big endian - let dataCodewords: Array = []; + const dataCodewords: Array = []; while (dataCodewords.length * 8 < bb.length) dataCodewords.push(0); bb.forEach((b: bit, i: int) => (dataCodewords[i >>> 3] |= b << (7 - (i & 7)))); @@ -184,7 +184,7 @@ export class QrCode { this.size = version * 4 + 17; // Initialize both grids to be size*size arrays of Boolean false - let row: Array = []; + const row: Array = []; for (let i = 0; i < this.size; i++) row.push(false); for (let i = 0; i < this.size; i++) { this.modules.push(row.slice()); // Initially all light @@ -350,10 +350,10 @@ export class QrCode { const shortBlockLen: int = Math.floor(rawCodewords / numBlocks); // Split data into blocks and append ECC to each block - let blocks: Array> = []; + const blocks: Array> = []; const rsDiv: Array = QrCode.reedSolomonComputeDivisor(blockEccLen); for (let i = 0, k = 0; i < numBlocks; i++) { - let dat: Array = data.slice(k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1)); + const dat: Array = data.slice(k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1)); k += dat.length; const ecc: Array = QrCode.reedSolomonComputeRemainder(dat, rsDiv); if (i < numShortBlocks) dat.push(0); @@ -361,7 +361,7 @@ export class QrCode { } // Interleave (not concatenate) the bytes from every block into a single sequence - let result: Array = []; + const result: Array = []; for (let i = 0; i < blocks[0].length; i++) { blocks.forEach((block, j) => { // Skip the padding byte in short blocks @@ -452,7 +452,7 @@ export class QrCode { for (let y = 0; y < this.size; y++) { let runColor = false; let runX = 0; - let runHistory = [0, 0, 0, 0, 0, 0, 0]; + const runHistory = [0, 0, 0, 0, 0, 0, 0]; for (let x = 0; x < this.size; x++) { if (this.modules[y][x] == runColor) { runX++; @@ -471,7 +471,7 @@ export class QrCode { for (let x = 0; x < this.size; x++) { let runColor = false; let runY = 0; - let runHistory = [0, 0, 0, 0, 0, 0, 0]; + const runHistory = [0, 0, 0, 0, 0, 0, 0]; for (let y = 0; y < this.size; y++) { if (this.modules[y][x] == runColor) { runY++; @@ -518,7 +518,7 @@ export class QrCode { else { const numAlign: int = Math.floor(this.version / 7) + 2; const step: int = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2; - let result: Array = [6]; + const result: Array = [6]; for (let pos = this.size - 7; result.length < numAlign; pos -= step) result.splice(1, 0, pos); return result; } @@ -555,7 +555,7 @@ export class QrCode { if (degree < 1 || degree > 255) throw new RangeError("Degree out of range"); // Polynomial coefficients are stored from highest to lowest power, excluding the leading term which is always 1. // For example the polynomial x^3 + 255x^2 + 8x + 93 is stored as the uint8 array [255, 8, 93]. - let result: Array = []; + const result: Array = []; for (let i = 0; i < degree - 1; i++) result.push(0); result.push(1); // Start off with the monomial x^0 @@ -576,7 +576,7 @@ export class QrCode { // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials. private static reedSolomonComputeRemainder(data: Readonly>, divisor: Readonly>): Array { - let result: Array = divisor.map((_) => 0); + const result: Array = divisor.map((_) => 0); for (const b of data) { // Polynomial division const factor: byte = b ^ (result.shift() as byte); @@ -730,7 +730,7 @@ export class QrSegment { // byte mode. All input byte arrays are acceptable. Any text string // can be converted to UTF-8 bytes and encoded as a byte mode segment. public static makeBytes(data: Readonly>): QrSegment { - let bb: Array = []; + const bb: Array = []; for (const b of data) appendBits(b, 8, bb); return new QrSegment(Mode.BYTE, data.length, bb); } @@ -738,7 +738,7 @@ export class QrSegment { // Returns a segment representing the given string of decimal digits encoded in numeric mode. public static makeNumeric(digits: string): QrSegment { if (!QrSegment.isNumeric(digits)) throw new RangeError("String contains non-numeric characters"); - let bb: Array = []; + const bb: Array = []; for (let i = 0; i < digits.length; ) { // Consume up to 3 digits per iteration const n: int = Math.min(digits.length - i, 3); @@ -754,7 +754,7 @@ export class QrSegment { public static makeAlphanumeric(text: string): QrSegment { if (!QrSegment.isAlphanumeric(text)) throw new RangeError("String contains unencodable characters in alphanumeric mode"); - let bb: Array = []; + const bb: Array = []; let i: int; for (i = 0; i + 2 <= text.length; i += 2) { // Process groups of 2 @@ -781,7 +781,7 @@ export class QrSegment { // Returns a segment representing an Extended Channel Interpretation // (ECI) designator with the given assignment value. public static makeEci(assignVal: int): QrSegment { - let bb: Array = []; + const bb: Array = []; if (assignVal < 0) throw new RangeError("ECI assignment value out of range"); else if (assignVal < 1 << 7) appendBits(assignVal, 8, bb); else if (assignVal < 1 << 14) { @@ -850,7 +850,7 @@ export class QrSegment { // Returns a new array of bytes representing the given string encoded in UTF-8. private static toUtf8ByteArray(str: string): Array { str = encodeURI(str); - let result: Array = []; + const result: Array = []; for (let i = 0; i < str.length; i++) { if (str.charAt(i) != "%") result.push(str.charCodeAt(i)); else { diff --git a/src/providers/global/notifications-provider.tsx b/src/providers/global/notifications-provider.tsx index 8ea63cb4a..0447257a0 100644 --- a/src/providers/global/notifications-provider.tsx +++ b/src/providers/global/notifications-provider.tsx @@ -65,7 +65,7 @@ export default function NotificationsProvider({ children }: PropsWithChildren) { const n = new AccountNotifications(account.pubkey); setNotifications(n); if (import.meta.env.DEV) { - // @ts-expect-error + // @ts-expect-error debug window.accountNotifications = n; } diff --git a/src/providers/global/publish-provider.tsx b/src/providers/global/publish-provider.tsx index 985c53577..77431786d 100644 --- a/src/providers/global/publish-provider.tsx +++ b/src/providers/global/publish-provider.tsx @@ -112,7 +112,7 @@ export default function PublishProvider({ children }: PropsWithChildren) { if (!Object.hasOwn(event, "pubkey")) event = await finalizeDraft(event); // sign event - let signed = !Object.hasOwn(event, "sig") ? await requestSignature(event) : (event as NostrEvent); + const signed = !Object.hasOwn(event, "sig") ? await requestSignature(event) : (event as NostrEvent); const pub = new PublishAction(label, relays, signed); setLog((arr) => arr.concat(pub)); diff --git a/src/providers/global/web-of-trust-provider.tsx b/src/providers/global/web-of-trust-provider.tsx index 65b7018c3..1ec3bcf2c 100644 --- a/src/providers/global/web-of-trust-provider.tsx +++ b/src/providers/global/web-of-trust-provider.tsx @@ -75,7 +75,7 @@ export default function WebOfTrustProvider({ pubkey, children }: PropsWithChildr if (!graph) return; if (import.meta.env.DEV) { - //@ts-expect-error + //@ts-expect-error debug window.webOfTrust = graph; } diff --git a/src/providers/route/require-current-account.tsx b/src/providers/route/require-current-account.tsx index 1d5f937fa..ffd3a6edb 100644 --- a/src/providers/route/require-current-account.tsx +++ b/src/providers/route/require-current-account.tsx @@ -6,7 +6,7 @@ import accountService from "../../services/account"; import { deleteDatabase } from "../../services/db"; export default function RequireCurrentAccount({ children }: { children: JSX.Element }) { - let location = useLocation(); + const location = useLocation(); const loading = useObservable(accountService.loading); const account = useObservable(accountService.current); diff --git a/src/queries/trusted-mints.ts b/src/queries/trusted-mints.ts index 63d19985d..ba28158ec 100644 --- a/src/queries/trusted-mints.ts +++ b/src/queries/trusted-mints.ts @@ -28,7 +28,7 @@ export default function TrustedMintsQuery(pubkey: string): Query { }, 1000 * 60); if (import.meta.env.DEV) { - // @ts-ignore + // @ts-expect-error debug window.dnsIdentityService = dnsIdentityService; } diff --git a/src/services/event-count.ts b/src/services/event-count.ts index f5e5df35d..980766e18 100644 --- a/src/services/event-count.ts +++ b/src/services/event-count.ts @@ -38,7 +38,7 @@ class EventCountService { const eventCountService = new EventCountService(); if (import.meta.env.DEV) { - // @ts-ignore + // @ts-expect-error debug window.eventCountService = eventCountService; } diff --git a/src/services/event-reactions.ts b/src/services/event-reactions.ts index 4ff4ea045..f67efdb63 100644 --- a/src/services/event-reactions.ts +++ b/src/services/event-reactions.ts @@ -47,7 +47,7 @@ class EventReactionsService { const eventReactionsService = new EventReactionsService(); if (import.meta.env.DEV) { - // @ts-ignore + // @ts-expect-error debug window.eventReactionsService = eventReactionsService; } diff --git a/src/services/event-store.ts b/src/services/event-store.ts index bcd559e06..87031ac81 100644 --- a/src/services/event-store.ts +++ b/src/services/event-store.ts @@ -4,8 +4,8 @@ export const eventStore = new EventStore(); export const queryStore = new QueryStore(eventStore); if (import.meta.env.DEV) { - // @ts-expect-error + // @ts-expect-error debug window.eventStore = eventStore; - // @ts-expect-error + // @ts-expect-error debug window.queryStore = queryStore; } diff --git a/src/services/event-zaps.ts b/src/services/event-zaps.ts index 707296ccf..293af6658 100644 --- a/src/services/event-zaps.ts +++ b/src/services/event-zaps.ts @@ -47,7 +47,7 @@ class EventZapsService { const eventZapsService = new EventZapsService(); if (import.meta.env.DEV) { - // @ts-ignore + // @ts-expect-error debug window.eventZapsService = eventZapsService; } diff --git a/src/services/local-relay.ts b/src/services/local-relay.ts index dbe50ac0f..b0502ed0f 100644 --- a/src/services/local-relay.ts +++ b/src/services/local-relay.ts @@ -109,8 +109,8 @@ setInterval(() => { }, 60_000); if (import.meta.env.DEV) { - //@ts-ignore + //@ts-expect-error debug window.localDatabase = localDatabase; - //@ts-ignore + //@ts-expect-error debug window.localRelay = localRelay; } diff --git a/src/services/local-settings.ts b/src/services/local-settings.ts index c7ccddf67..65b9dc72a 100644 --- a/src/services/local-settings.ts +++ b/src/services/local-settings.ts @@ -77,7 +77,7 @@ const localSettings = { }; if (import.meta.env.DEV) { - // @ts-expect-error + // @ts-expect-error debug window.localSettings = localSettings; } diff --git a/src/services/page-api.ts b/src/services/page-api.ts index 5b26227e6..2b2f28662 100644 --- a/src/services/page-api.ts +++ b/src/services/page-api.ts @@ -48,6 +48,6 @@ const noStrudel = { localSettings.debugApi.subscribe((enabled) => { if (enabled) Reflect.set(window, "noStrudel", noStrudel); - // @ts-expect-error + // @ts-expect-error debug else delete window.noStrudel; }); diff --git a/src/services/process-manager.ts b/src/services/process-manager.ts index d2224a779..cf0e93998 100644 --- a/src/services/process-manager.ts +++ b/src/services/process-manager.ts @@ -40,7 +40,7 @@ class ProcessManager { const processManager = new ProcessManager(); if (import.meta.env.DEV) { - // @ts-expect-error + // @ts-expect-error debug window.processManager = processManager; } diff --git a/src/services/read-status.ts b/src/services/read-status.ts index 1f283b7ff..a744d93b7 100644 --- a/src/services/read-status.ts +++ b/src/services/read-status.ts @@ -107,7 +107,7 @@ const readStatusService = new ReadStatusService(); setInterval(readStatusService.prune.bind(readStatusService), 30_000); if (import.meta.env.DEV) { - // @ts-expect-error + // @ts-expect-error debug window.readStatusService = readStatusService; } diff --git a/src/services/relay-pool.ts b/src/services/relay-pool.ts index 2851c3883..5cef5ff82 100644 --- a/src/services/relay-pool.ts +++ b/src/services/relay-pool.ts @@ -26,7 +26,7 @@ if (localRelay instanceof AbstractRelay) { } if (import.meta.env.DEV) { - // @ts-ignore + // @ts-expect-error debug window.relayPoolService = relayPoolService; } diff --git a/src/services/relay-scoreboard.ts b/src/services/relay-scoreboard.ts index 3ec34ae15..c7e2b4b86 100644 --- a/src/services/relay-scoreboard.ts +++ b/src/services/relay-scoreboard.ts @@ -264,7 +264,7 @@ setInterval(() => { }, 1000 * 30); if (import.meta.env.DEV) { - // @ts-ignore + // @ts-expect-error debug window.relayScoreboardService = relayScoreboardService; } diff --git a/src/services/relay-stats.ts b/src/services/relay-stats.ts index f9c7aeb16..c6175b730 100644 --- a/src/services/relay-stats.ts +++ b/src/services/relay-stats.ts @@ -98,7 +98,7 @@ class RelayStatsService { const relayStatsService = new RelayStatsService(); if (import.meta.env.DEV) { - //@ts-ignore + //@ts-expect-error debug window.relayStatsService = relayStatsService; } diff --git a/src/services/replaceable-events.ts b/src/services/replaceable-events.ts index 2b1a7af73..b666432aa 100644 --- a/src/services/replaceable-events.ts +++ b/src/services/replaceable-events.ts @@ -114,7 +114,7 @@ class ReplaceableEventsService { const replaceableEventsService = new ReplaceableEventsService(eventStore); if (import.meta.env.DEV) { - //@ts-ignore + //@ts-expect-error debug window.replaceableEventsService = replaceableEventsService; } diff --git a/src/services/username-search.ts b/src/services/username-search.ts index b8fbd7b3b..4c8baad57 100644 --- a/src/services/username-search.ts +++ b/src/services/username-search.ts @@ -28,7 +28,7 @@ const updates = eventStore.stream([{ kinds: [kinds.Metadata] }]).pipe( const updates: UserDirectory = {}; const transaction = db.transaction("userSearch", "readwrite"); - for (let metadata of events) { + for (const metadata of events) { const profile = getProfileContent(metadata); const names = getSearchNames(profile); updates[metadata.pubkey] = names; diff --git a/src/views/communities/components/community-mod-list.tsx b/src/views/communities/components/community-mod-list.tsx index 1e72b54b8..2c011db94 100644 --- a/src/views/communities/components/community-mod-list.tsx +++ b/src/views/communities/components/community-mod-list.tsx @@ -13,7 +13,7 @@ export default function CommunityModList({ return ( {mods.map((pubkey) => ( - + ))} ); diff --git a/src/views/community/components/horizonal-community-details.tsx b/src/views/community/components/horizonal-community-details.tsx index 7eb11341c..214bf365c 100644 --- a/src/views/community/components/horizonal-community-details.tsx +++ b/src/views/community/components/horizonal-community-details.tsx @@ -72,7 +72,7 @@ export default function HorizontalCommunityDetails({ {mods.map((pubkey) => ( - + @@ -117,7 +117,7 @@ export default function HorizontalCommunityDetails({ {links.map(([url, name]) => ( - + {name || url} ))} diff --git a/src/views/community/components/vertical-community-details.tsx b/src/views/community/components/vertical-community-details.tsx index ae5bf8753..723818b28 100644 --- a/src/views/community/components/vertical-community-details.tsx +++ b/src/views/community/components/vertical-community-details.tsx @@ -54,7 +54,7 @@ export default function VerticalCommunityDetails({ {mods.map((pubkey) => ( - + @@ -99,7 +99,7 @@ export default function VerticalCommunityDetails({ {links.map(([url, name]) => ( - + {name || url} ))} diff --git a/src/views/discovery/dvm-feed/components/feed.tsx b/src/views/discovery/dvm-feed/components/feed.tsx index 7c8bdbc76..b22a68694 100644 --- a/src/views/discovery/dvm-feed/components/feed.tsx +++ b/src/views/discovery/dvm-feed/components/feed.tsx @@ -1,5 +1,6 @@ import FeedStatus from "./feed-status"; import { AddressPointer } from "nostr-tools/nip19"; +import { getEventUID } from "applesauce-core/helpers"; import { ChainedDVMJob, getEventIdsFromJobs } from "../../../../helpers/nostr/dvm"; import useSingleEvents from "../../../../hooks/use-single-events"; @@ -12,7 +13,7 @@ function FeedEvents({ chain }: { chain: ChainedDVMJob[] }) { return ( <> {events.map((event) => ( - + ))} ); diff --git a/src/views/goals/components/goal-contents.tsx b/src/views/goals/components/goal-contents.tsx index b9fa895c0..08c91b161 100644 --- a/src/views/goals/components/goal-contents.tsx +++ b/src/views/goals/components/goal-contents.tsx @@ -15,7 +15,7 @@ export default function GoalContents({ goal }: { goal: NostrEvent }) { ))} {links.map((link) => ( - + ))} ); diff --git a/src/views/link/index.tsx b/src/views/link/index.tsx index 0676e682d..b4df9f682 100644 --- a/src/views/link/index.tsx +++ b/src/views/link/index.tsx @@ -44,7 +44,7 @@ function RenderRedirect({ event, link }: { event?: NostrEvent; link: string }) { return ; case "nevent": case "naddr": { - let k = decoded.data.kind || event?.kind; + const k = decoded.data.kind || event?.kind; if (k === kinds.ShortTextNote) return ; if (k === TORRENT_KIND) return ; if (k === kinds.LiveEvent) return ; diff --git a/src/views/lists/list/index.tsx b/src/views/lists/list/index.tsx index 111f89ba4..3abb3a9a7 100644 --- a/src/views/lists/list/index.tsx +++ b/src/views/lists/list/index.tsx @@ -85,7 +85,7 @@ function ListPage({ list }: { list: NostrEvent }) { People {people.map(({ pubkey, relay }) => ( - + ))} @@ -96,7 +96,7 @@ function ListPage({ list }: { list: NostrEvent }) { Notes {notes.map(({ id, relays }) => ( - + ))} diff --git a/src/views/relays/browse-sets.tsx b/src/views/relays/browse-sets.tsx index 7309a73d8..8d185e329 100644 --- a/src/views/relays/browse-sets.tsx +++ b/src/views/relays/browse-sets.tsx @@ -23,7 +23,7 @@ function RelaySetCard({ set }: { set: NostrEvent }) { {name} {relays.map((relay) => ( - + {relay} ))} diff --git a/src/views/relays/media-servers/index.tsx b/src/views/relays/media-servers/index.tsx index a10176ddc..e7cbf4dd8 100644 --- a/src/views/relays/media-servers/index.tsx +++ b/src/views/relays/media-servers/index.tsx @@ -82,7 +82,7 @@ function MediaServersPage() { const [confirmServer, setConfirmServer] = useState(""); const submit = handleSubmit(async (values) => { - let url = new URL(values.server.startsWith("http") ? values.server : "https://" + values.server).toString(); + const url = new URL(values.server.startsWith("http") ? values.server : "https://" + values.server).toString(); if (event?.tags.some((t) => isServerTag(t) && areServersEqual(t[1], url))) return toast({ status: "error", description: "Server already in list" }); diff --git a/src/views/relays/relay/relay-details.tsx b/src/views/relays/relay/relay-details.tsx index 7c34bfa94..70861d57e 100644 --- a/src/views/relays/relay/relay-details.tsx +++ b/src/views/relays/relay/relay-details.tsx @@ -102,7 +102,7 @@ export default function RelayDetailsTab({ relay }: { relay: string }) { const token = theme.semanticTokens.colors["chakra-body-text"]; const color = useColorModeValue(token._light, token._dark) as string; - const [_, update] = useState(); + const [_, update] = useState(); const store = useMemo(() => new EventStore(), []); const [loading, setLoading] = useState(false); diff --git a/src/views/search/index.tsx b/src/views/search/index.tsx index 6c0c81111..d67a1d771 100644 --- a/src/views/search/index.tsx +++ b/src/views/search/index.tsx @@ -32,7 +32,7 @@ export function SearchPage() { const searchQuery = params.get("q") || ""; const relayURL = params.get("relay"); - let searchRelay = useMemo(() => { + const searchRelay = useMemo(() => { if (relayURL === "local") return localRelay; else if (relayURL) return relayPoolService.requestRelay(relayURL); else if (localSearchSupported) return localRelay; diff --git a/src/views/signin/address/index.tsx b/src/views/signin/address/index.tsx index 65393171c..d809770b6 100644 --- a/src/views/signin/address/index.tsx +++ b/src/views/signin/address/index.tsx @@ -27,7 +27,7 @@ export default function LoginNostrAddressView() { async () => { if (!address) return setNip05(undefined); if (!getMatchSimpleEmail().test(address)) return setNip05(undefined); - let [name, domain] = address.split("@"); + const [name, domain] = address.split("@"); if (!name || !domain) return setNip05(undefined); setNip05((await dnsIdentityService.fetchIdentity(address)) ?? null); setRootNip05((await dnsIdentityService.fetchIdentity(`_@${domain}`)) ?? null); diff --git a/src/views/signin/nostr-connect.tsx b/src/views/signin/nostr-connect.tsx index 15cce8931..0df773f84 100644 --- a/src/views/signin/nostr-connect.tsx +++ b/src/views/signin/nostr-connect.tsx @@ -58,7 +58,7 @@ function ClientConnectForm() { <> {signer ? ( <> - + @@ -109,7 +109,7 @@ export default function LoginNostrConnectView() { try { setLoading("Connecting..."); - let client = await NostrConnectSigner.fromBunkerURI(connection, relayPoolService, NOSTR_CONNECT_PERMISSIONS); + const client = await NostrConnectSigner.fromBunkerURI(connection, relayPoolService, NOSTR_CONNECT_PERMISSIONS); const pubkey = await client.getPublicKey(); const account = new NostrConnectAccount(pubkey, client); diff --git a/src/views/task-manager/processes/process/process-icon.tsx b/src/views/task-manager/processes/process/process-icon.tsx index 9b262623f..37ecc5afe 100644 --- a/src/views/task-manager/processes/process/process-icon.tsx +++ b/src/views/task-manager/processes/process/process-icon.tsx @@ -4,7 +4,7 @@ import { ComponentWithAs, IconProps } from "@chakra-ui/react"; import Process from "../../../../classes/process"; export default function ProcessIcon({ process, ...props }: { process: Process } & IconProps) { - let IconComponent: ComponentWithAs<"svg", IconProps> = process.icon || QuestionIcon; + const IconComponent: ComponentWithAs<"svg", IconProps> = process.icon || QuestionIcon; return ; } diff --git a/src/views/thread/components/tabs/tools/summary.tsx b/src/views/thread/components/tabs/tools/summary.tsx index eb39d65a9..b283b6f84 100644 --- a/src/views/thread/components/tabs/tools/summary.tsx +++ b/src/views/thread/components/tabs/tools/summary.tsx @@ -4,7 +4,7 @@ import { Button, Flex, Spinner, Text, Textarea, useToast } from "@chakra-ui/reac import { EventTemplate, NostrEvent } from "nostr-tools"; import { MultiSubscription } from "applesauce-net/subscription"; import { useStoreQuery } from "applesauce-react/hooks"; -import { unixNow } from "applesauce-core/helpers"; +import { getEventUID, unixNow } from "applesauce-core/helpers"; import { useUserInbox } from "../../../../../hooks/use-user-mailboxes"; import useCurrentAccount from "../../../../../hooks/use-current-account"; @@ -86,7 +86,7 @@ export default function EventSummarizePage({ event }: { event: NostrEvent }) { {responses ? ( <> {Object.entries(responses).map(([pubkey, event]) => ( - + ))} ) : submitted ? ( diff --git a/src/views/tools/event-console/index.tsx b/src/views/tools/event-console/index.tsx index 44418ae8b..3c38ca18d 100644 --- a/src/views/tools/event-console/index.tsx +++ b/src/views/tools/event-console/index.tsx @@ -104,7 +104,7 @@ export default function EventConsoleView() { } await new Promise((res) => { - let buffer: NostrEvent[] = []; + const buffer: NostrEvent[] = []; const flush = _throttle(() => setEvents([...buffer]), 1000 / 10, { trailing: true }); setError(""); diff --git a/src/views/tools/event-console/user-autocomplete.ts b/src/views/tools/event-console/user-autocomplete.ts index 4a2baa055..549d8ec8a 100644 --- a/src/views/tools/event-console/user-autocomplete.ts +++ b/src/views/tools/event-console/user-autocomplete.ts @@ -5,11 +5,11 @@ import { SearchDirectory, userSearchDirectory } from "../../../services/username let users: SearchDirectory = []; export function codeMirrorUserAutocomplete(context: CompletionContext): CompletionResult | null { - let nodeBefore = syntaxTree(context.state).resolveInner(context.pos, -1); + const nodeBefore = syntaxTree(context.state).resolveInner(context.pos, -1); if (nodeBefore.name !== "String") return null; - let textBefore = context.state.sliceDoc(nodeBefore.from, context.pos); - let tagBefore = /@\w*$/.exec(textBefore); + const textBefore = context.state.sliceDoc(nodeBefore.from, context.pos); + const tagBefore = /@\w*$/.exec(textBefore); if (!tagBefore && !context.explicit) return null; return { diff --git a/src/views/tools/event-publisher/index.tsx b/src/views/tools/event-publisher/index.tsx index c4b23d460..a238db24c 100644 --- a/src/views/tools/event-publisher/index.tsx +++ b/src/views/tools/event-publisher/index.tsx @@ -158,7 +158,9 @@ function EventPublisherPage({ initDraft }: { initDraft?: LooseEventTemplate }) { Template diff --git a/src/views/tools/transform-note/translation/index.tsx b/src/views/tools/transform-note/translation/index.tsx index b099a32ba..64d60c4f6 100644 --- a/src/views/tools/transform-note/translation/index.tsx +++ b/src/views/tools/transform-note/translation/index.tsx @@ -72,7 +72,7 @@ export function NoteTranslationsPage({ note }: { note: NostrEvent }) { } onClick={showPlayer.onOpen} size="md" variant="outline" /> - {waveform?.map((v) => )} + {waveform?.map((v, i) => )} ); diff --git a/src/views/user/components/user-zap-button.tsx b/src/views/user/components/user-zap-button.tsx index a205f4ed3..8b9851692 100644 --- a/src/views/user/components/user-zap-button.tsx +++ b/src/views/user/components/user-zap-button.tsx @@ -11,7 +11,7 @@ export default function UserZapButton({ pubkey, ...props }: { pubkey: string } & if (!metadata) return null; // use lud06 and lud16 fields interchangeably - let tipAddress = metadata.lud06 || metadata.lud16; + const tipAddress = metadata.lud06 || metadata.lud16; if (!tipAddress) return null; diff --git a/src/views/videos/components/video-card.tsx b/src/views/videos/components/video-card.tsx index ecf126c84..4ff93c4ec 100644 --- a/src/views/videos/components/video-card.tsx +++ b/src/views/videos/components/video-card.tsx @@ -2,7 +2,7 @@ import { Box, Card, CardBody, CardHeader, CardProps, Heading, LinkBox, Text } fr import { Link as RouterLink } from "react-router-dom"; import { NostrEvent } from "../../../types/nostr-event"; -import { getVideoDuration, getVideoImages, getVideoSummary, getVideoTitle } from "../../../helpers/nostr/video"; +import { getVideoImages, getVideoSummary, getVideoTitle } from "../../../helpers/nostr/video"; import HoverLinkOverlay from "../../../components/hover-link-overlay"; import useEventIntersectionRef from "../../../hooks/use-event-intersection-ref"; import useShareableEventAddress from "../../../hooks/use-shareable-event-address"; @@ -10,14 +10,13 @@ import useShareableEventAddress from "../../../hooks/use-shareable-event-address export default function VideoCard({ video, ...props }: Omit & { video: NostrEvent }) { const title = getVideoTitle(video); const { thumb } = getVideoImages(video); - const duration = getVideoDuration(video); const summary = getVideoSummary(video); const ref = useEventIntersectionRef(video); const address = useShareableEventAddress(video); return ( - +