aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/web/explore/code.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/routers/web/explore/code.go b/routers/web/explore/code.go
index 2357b34fd0..38474255d1 100644
--- a/routers/web/explore/code.go
+++ b/routers/web/explore/code.go
@@ -110,6 +110,18 @@ func Code(ctx *context.Context) {
}
ctx.Data["RepoMaps"] = repoMaps
+
+ if len(loadRepoIDs) != len(repoMaps) {
+ // Remove deleted repos from search results
+ cleanedSearchResults := make([]*code_indexer.Result, 0, len(repoMaps))
+ for _, sr := range searchResults {
+ if _, found := repoMaps[sr.RepoID]; found {
+ cleanedSearchResults = append(cleanedSearchResults, sr)
+ }
+ }
+
+ searchResults = cleanedSearchResults
+ }
}
ctx.Data["SearchResults"] = searchResults