diff options
| author | Mistivia <i@mistivia.com> | 2025-02-10 23:21:24 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-02-10 23:21:24 +0800 |
| commit | 39c98aef0b1077001571a11adfd6b4c80dec256a (patch) | |
| tree | 495455d698594b7f3fa0dcf7be39b7e549eedf28 /src/control/search.js | |
| parent | 45337902f925e8d826aae5a2347029ab03753113 (diff) | |
add loading page
Diffstat (limited to 'src/control/search.js')
| -rw-r--r-- | src/control/search.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/control/search.js b/src/control/search.js index 4ebe9bf..5927950 100644 --- a/src/control/search.js +++ b/src/control/search.js @@ -1,5 +1,5 @@ import { writable } from 'svelte/store'; -import { cardDb } from '../data/cardDb'; +import { getCardDb} from '../data/cardDb'; let showingCards = writable([]); let resultCards = []; @@ -18,6 +18,7 @@ function changeInput(query) { } function doSearch(ver, query) { + let cardDb = getCardDb(); let result = []; for (let key in cardDb) { if (ver !== curVer) { @@ -50,7 +51,9 @@ function doSearch(ver, query) { showCards(); } -doSearch(curVer, ""); +function initSearch() { + doSearch(curVer, ""); +} function onPrevPage() { if (curPage > 0) { @@ -72,4 +75,5 @@ export { onPrevPage, onNextPage, showingCards, + initSearch, }; |
