Browse Source

fix: RecentRepos hardcoded workaround

to prevent repeated rendering of the same repository as a new item

nostr:nevent1qvzqqqqqqypzq3an3axnwgfep4dkhmmcmt3l8cug3mxm7xzylwenhzrjr5mx6hygqy88wumn8ghj7mn0wvhxcmmv9uq3vamnwvaz7tmsw4e8qmr9wfjkccte9e3k7mf0qqsdfpddg0e9k3k0k3tt7hkyemd936ec2wf6afufxn09hp42fq2q56qpxf7y4
master
DanConwayDev 2 years ago
parent
commit
104562feac
No known key found for this signature in database
GPG Key ID: 68E15486D73F75E1
  1. 12
      src/lib/stores/repos.ts

12
src/lib/stores/repos.ts

@ -356,6 +356,11 @@ export const ensureRecentReposEvents = () => { @@ -356,6 +356,11 @@ export const ensureRecentReposEvents = () => {
const summary = repoCollectionToSummary(repo_collection)
if (!summary) return
recent_repo_summaries.update((repos) => {
if (
summary.identifier === 'dotfiles' &&
repos.some((repo) => repo.identifier === 'dotfiles')
)
return [...repos]
// if duplicate
if (
repos.some(
@ -382,7 +387,12 @@ export const ensureRecentReposEvents = () => { @@ -382,7 +387,12 @@ export const ensureRecentReposEvents = () => {
].sort((a, b) => b.created_at - a.created_at)
}
// if not duplicate - add summary
else if (summary) return [...repos, summary]
else if (summary) {
console.log(
`${summary.identifier} ${summary.unique_commit} col ${repo_collection.unique_commit}`
)
return [...repos, summary]
}
return [...repos]
})
})

Loading…
Cancel
Save