diff --git a/frontend/app.js b/frontend/app.js index fbad92a..b570d43 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -499,7 +499,8 @@ this._titlesSection.hidden = !(titlesRes.suggestions || []).length; if (titlesRes.suggestions?.length) this.show(); } catch (err) { - if (err.name !== "AbortError") this._titlesSection.hidden = true; + if (err.name === "AbortError") return; // new request superseded this one + this._titlesSection.hidden = true; } try { const tagsRes = await api(`/api/tags/suggest?q=${encodeURIComponent(prefix)}&vault=${encodeURIComponent(vault)}&limit=5`, { signal: suggestAbortController.signal }); @@ -507,10 +508,13 @@ this._tagsSection.hidden = !(tagsRes.suggestions || []).length; if (tagsRes.suggestions?.length) this.show(); } catch (err) { - if (err.name !== "AbortError") this._tagsSection.hidden = true; + if (err.name === "AbortError") return; + this._tagsSection.hidden = true; } this._collectItems(); }, + this._collectItems(); + }, _renderHistory(items, query) { this._historyList.innerHTML = "";