remember last query until refresh
This commit is contained in:
@@ -258,6 +258,10 @@ class Loader{
|
|||||||
db = new IDB("taiko", "store")
|
db = new IDB("taiko", "store")
|
||||||
plugins = new Plugins()
|
plugins = new Plugins()
|
||||||
|
|
||||||
|
if(localStorage.getItem("lastSearchQuery")){
|
||||||
|
localStorage.removeItem("lastSearchQuery")
|
||||||
|
}
|
||||||
|
|
||||||
Promise.all(this.promises).then(() => {
|
Promise.all(this.promises).then(() => {
|
||||||
if(this.error){
|
if(this.error){
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -2798,6 +2798,12 @@ class SongSelect{
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.search.input.focus()
|
this.search.input.focus()
|
||||||
}, 10)
|
}, 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){
|
removeSearch(byUser=false){
|
||||||
@@ -2987,6 +2993,7 @@ class SongSelect{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var new_results = this.performSearch(text)
|
var new_results = this.performSearch(text)
|
||||||
|
localStorage.setItem("lastSearchQuery", text)
|
||||||
|
|
||||||
if (new_results.length === 0) {
|
if (new_results.length === 0) {
|
||||||
this.setSearchTip(strings.search.noResults, true)
|
this.setSearchTip(strings.search.noResults, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user