fix(ui): stop the chat input attach menus from fetching twice on open (#27461)

This commit is contained in:
G30
2026-07-26 18:14:06 -04:00
committed by GitHub
parent e140d8f3cc
commit 527b0d3b7f
4 changed files with 25 additions and 14 deletions
@@ -25,11 +25,13 @@
let itemsLoading = false;
let allItemsLoaded = false;
let initialized = false;
let searchedQuery = '';
let searchDebounceTimer: ReturnType<typeof setTimeout>;
let requestId = 0;
$: if (initialized) {
query;
// Only re-run the search when the query actually changes. Flipping `initialized`
// after the initial load would otherwise trigger a second, identical request.
$: if (initialized && query !== searchedQuery) {
scheduleSearch();
}
@@ -40,6 +42,7 @@
const init = async () => {
requestId += 1;
searchedQuery = query;
page = 1;
items = [];
selectedIdx = 0;