This commit is contained in:
TheGiddyLimit
2024-05-26 23:02:59 +01:00
parent d2f2daa34e
commit 0cd7a2a6fa
13 changed files with 105 additions and 78 deletions

View File

@@ -182,9 +182,14 @@ class SearchPage {
}
if (this._PARAM_LUCKY in params) {
const [result] = results;
window.location = `${Renderer.get().baseUrl}${Omnisearch.getResultHref(result.doc)}`;
return;
const [href] = results
.map(res => Omnisearch.getResultHref(res.doc))
.filter(Boolean);
if (href) {
window.location = `${Renderer.get().baseUrl}${href}`;
return;
}
}
SearchPage._rowMetas = results.map(result => {