From 0ba508cd0bddefae7ee5c88f44056be093f36ffb Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Mon, 26 Jan 2026 15:42:40 +0100 Subject: [PATCH] fix(webui): prevent empty search and cancel search on modal close - Add input validation to prevent search when keyword is empty or whitespace - Close EventSource connection when search modal is closed to stop ongoing searches Co-Authored-By: Claude Opus 4.5 --- webui/src/store/search.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/webui/src/store/search.ts b/webui/src/store/search.ts index f3dcc532..068976a5 100644 --- a/webui/src/store/search.ts +++ b/webui/src/store/search.ts @@ -227,6 +227,7 @@ export const useSearchStore = defineStore('search', () => { function closeModal() { showModal.value = false; selectedResult.value = null; + closeSearch(); } function toggleModal() { @@ -277,6 +278,13 @@ export const useSearchStore = defineStore('search', () => { selectedResult.value = null; } + function onSearch() { + if (!keyword.value.trim()) { + return; + } + openSearch(); + } + return { // State inputValue: keyword, @@ -295,7 +303,7 @@ export const useSearchStore = defineStore('search', () => { // Actions clearSearch, getProviders, - onSearch: openSearch, + onSearch, closeSearch, openModal, closeModal,