From 7a11742a7031084d5c49e7d7bfb19a258df74005 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 18 Sep 2024 15:49:09 +0100 Subject: [PATCH] feat: limit kinds displayed resolving: nostr:nevent1qvzqqqqx25pzplfq3m5v3u5r0q9f255fdeyz8nyac6lagssx8zy4wugxjs8ajf7pqyxhwumn8ghj7mn0wvhxcmmvqqspfyft430llz04euctxf06z26swatglyc5qczvzhpk29du8x9vf8q3hyn9e --- src/lib/stores/Issue.ts | 4 ++-- src/lib/stores/Proposal.ts | 4 ++-- src/lib/stores/utils.ts | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 src/lib/stores/utils.ts diff --git a/src/lib/stores/Issue.ts b/src/lib/stores/Issue.ts index e315381..9f23e3c 100644 --- a/src/lib/stores/Issue.ts +++ b/src/lib/stores/Issue.ts @@ -9,6 +9,7 @@ import { extractIssueTitle, } from '$lib/components/events/content/utils' import { selectRepoFromCollection } from '$lib/components/repo/utils' +import { ignore_kinds } from './utils' export const selected_issue_full: Writable = writable({ ...full_defaults, @@ -136,8 +137,7 @@ export const ensureIssueFull = ( ) const process_replies = (event: NDKEvent) => { - const amethyst_draft_kind = 31234 - if (event.kind && event.kind === amethyst_draft_kind) return + if (event.kind && ignore_kinds.includes(event.kind)) return false if ( event.kind && proposal_status_kinds.includes(event.kind) && diff --git a/src/lib/stores/Proposal.ts b/src/lib/stores/Proposal.ts index c43fc33..55e6b00 100644 --- a/src/lib/stores/Proposal.ts +++ b/src/lib/stores/Proposal.ts @@ -9,6 +9,7 @@ import { proposal_status_kinds, proposal_status_open } from '$lib/kinds' import { awaitSelectedRepoCollection } from './repo' import { extractPatchMessage } from '$lib/components/events/content/utils' import { selectRepoFromCollection } from '$lib/components/repo/utils' +import { ignore_kinds } from './utils' export const selected_proposal_full: Writable = writable({ ...full_defaults, @@ -142,8 +143,7 @@ export const ensureProposalFull = ( ) const process_replies = (event: NDKEvent) => { - const amethyst_draft_kind = 31234 - if (event.kind && event.kind === amethyst_draft_kind) return false + if (event.kind && ignore_kinds.includes(event.kind)) return false if ( event.kind && proposal_status_kinds.includes(event.kind) && diff --git a/src/lib/stores/utils.ts b/src/lib/stores/utils.ts new file mode 100644 index 0000000..553caa2 --- /dev/null +++ b/src/lib/stores/utils.ts @@ -0,0 +1,4 @@ +export const ignore_kinds = [ + 31234, // amethyst draft kind + 9978, // confidence scoring event +]