From 2c26c7d3390253e91aed04d7c21dbd062ff6583b Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 2 Jul 2024 11:12:39 +0100 Subject: [PATCH] fix: ensure repo naddr consistancy proposals / issues are fetched that tag the repo address pointer for each maintainer listed in the selected repo event. not just the ones that tag the selected proposal event. previously, the link to each proposal would change the selected repository to the first address pointer tagged in the proposal event not only is the selected repo changing without the user's knowledge, it can also cause an error if it points to a repo event that doesn't exist. this happned here: nostr:note1h25kwpycszl33285exdkrm4qz7a03e37nf4ujvexwqz94yj3k4xql9yj23 this ensures that the selected repo address pointer doesnt change. if the proposal is accessed via gitworkhop.dev/e/ the page will error. a seperate change is needed to check through each address pointer listed until it finds one that points to an actual event. --- src/lib/components/proposals/ProposalsList.svelte | 3 ++- src/lib/components/proposals/ProposalsListItem.svelte | 10 ++++++---- src/lib/components/repo/utils.ts | 2 +- src/routes/r/[repo_naddr]/issues/+page.svelte | 1 + src/routes/r/[repo_naddr]/proposals/+page.svelte | 1 + 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/lib/components/proposals/ProposalsList.svelte b/src/lib/components/proposals/ProposalsList.svelte index 8f433ca..a8f7db3 100644 --- a/src/lib/components/proposals/ProposalsList.svelte +++ b/src/lib/components/proposals/ProposalsList.svelte @@ -5,6 +5,7 @@ export let title: string = '' export let proposals_or_issues: ProposalSummary[] | IssueSummary[] = [] + export let repo_naddr_override: string | undefined = undefined; export let loading: boolean = false export let show_repo: boolean = false export let limit: number = 0 @@ -25,7 +26,7 @@