mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 07:21:50 +08:00
remember last query until refresh
This commit is contained in:
parent
d85d48bc1f
commit
1ef724c4c1
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user