mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-02 01:42:53 -05:00
fix(ui): stop the chat input attach menus from fetching twice on open (#27461)
This commit is contained in:
4 files changed
+25
-14
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user