diff --git a/public/src/js/loader.js b/public/src/js/loader.js index eba7371..1ca40d7 100644 --- a/public/src/js/loader.js +++ b/public/src/js/loader.js @@ -258,6 +258,10 @@ class Loader{ db = new IDB("taiko", "store") plugins = new Plugins() + if(localStorage.getItem("lastSearchQuery")){ + localStorage.removeItem("lastSearchQuery") + } + Promise.all(this.promises).then(() => { if(this.error){ return diff --git a/public/src/js/songselect.js b/public/src/js/songselect.js index 2a224c7..bcabd89 100644 --- a/public/src/js/songselect.js +++ b/public/src/js/songselect.js @@ -2798,6 +2798,12 @@ class SongSelect{ setTimeout(() => { this.search.input.focus() }, 10) + + var lastQuery = localStorage.getItem("lastSearchQuery") + if(lastQuery){ + this.search.input.value = lastQuery + this.search.input.dispatchEvent(new Event('input', {value: lastQuery})) + } } removeSearch(byUser=false){ @@ -2987,6 +2993,7 @@ class SongSelect{ } var new_results = this.performSearch(text) + localStorage.setItem("lastSearchQuery", text) if (new_results.length === 0) { this.setSearchTip(strings.search.noResults, true)