forked from tangled.org/core
this repo has no description

appview: handle deleted repos in profile timeline

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 5acf6587 716f0d3d

verified
Changed files
+8 -4
appview
+8 -4
appview/db/issues.go
···
repoMap[string(repos[i].RepoAt())] = &repos[i]
}
-
for issueAt := range issueMap {
-
i := issueMap[issueAt]
-
r := repoMap[string(i.RepoAt)]
-
i.Repo = r
+
for issueAt, i := range issueMap {
+
if r, ok := repoMap[string(i.RepoAt)]; ok {
+
i.Repo = r
+
} else {
+
// do not show up the issue if the repo is deleted
+
// TODO: foreign key where?
+
delete(issueMap, issueAt)
+
}
}
// collect comments