mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-24 12:30:38 -04:00
[web] Fix empty empty queries to not be saved
This commit is contained in:
parent
ed8e5710f3
commit
709b60858d
web-src/src/pages
@ -7,7 +7,6 @@
|
|||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="control has-icons-left">
|
<div class="control has-icons-left">
|
||||||
<input
|
<input
|
||||||
ref="search_field"
|
|
||||||
v-model="searchStore.query"
|
v-model="searchStore.query"
|
||||||
class="input is-rounded"
|
class="input is-rounded"
|
||||||
type="text"
|
type="text"
|
||||||
@ -163,23 +162,18 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
search(event) {
|
search(event) {
|
||||||
if (event) {
|
if (this.searchStore.query) {
|
||||||
this.types = SEARCH_TYPES
|
if (event) {
|
||||||
this.limit = PAGE_SIZE
|
this.types = SEARCH_TYPES
|
||||||
|
this.limit = PAGE_SIZE
|
||||||
|
}
|
||||||
|
this.searchStore.query = this.searchStore.query.trim()
|
||||||
|
this.reset()
|
||||||
|
this.types.forEach((type) => {
|
||||||
|
this.searchItems(type)
|
||||||
|
})
|
||||||
|
this.searchStore.add(this.searchStore.query)
|
||||||
}
|
}
|
||||||
this.searchStore.query = this.searchStore.query.trim()
|
|
||||||
if (
|
|
||||||
!this.searchStore.query ||
|
|
||||||
!this.searchStore.query.replace(/^query:/u, '')
|
|
||||||
) {
|
|
||||||
this.$refs.search_field.focus()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.reset()
|
|
||||||
this.types.forEach((type) => {
|
|
||||||
this.searchItems(type)
|
|
||||||
})
|
|
||||||
this.searchStore.add(this.searchStore.query)
|
|
||||||
},
|
},
|
||||||
searchItems(type) {
|
searchItems(type) {
|
||||||
const music = type !== 'audiobook' && type !== 'podcast'
|
const music = type !== 'audiobook' && type !== 'podcast'
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="control has-icons-left">
|
<div class="control has-icons-left">
|
||||||
<input
|
<input
|
||||||
ref="search_field"
|
|
||||||
v-model="searchStore.query"
|
v-model="searchStore.query"
|
||||||
class="input is-rounded"
|
class="input is-rounded"
|
||||||
type="text"
|
type="text"
|
||||||
@ -152,22 +151,20 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
search(event) {
|
search(event) {
|
||||||
if (event) {
|
if (this.searchStore.query) {
|
||||||
this.types = SEARCH_TYPES
|
if (event) {
|
||||||
this.parameters.limit = PAGE_SIZE
|
this.types = SEARCH_TYPES
|
||||||
}
|
this.parameters.limit = PAGE_SIZE
|
||||||
this.searchStore.query = this.searchStore.query.trim()
|
}
|
||||||
if (!this.searchStore.query) {
|
this.searchStore.query = this.searchStore.query.trim()
|
||||||
this.$refs.search_field.focus()
|
this.reset()
|
||||||
return
|
this.searchItems().then((data) => {
|
||||||
}
|
this.types.forEach((type) => {
|
||||||
this.reset()
|
this.results.set(type, data[`${type}s`])
|
||||||
this.searchItems().then((data) => {
|
})
|
||||||
this.types.forEach((type) => {
|
|
||||||
this.results.set(type, data[`${type}s`])
|
|
||||||
})
|
})
|
||||||
})
|
this.searchStore.add(this.searchStore.query)
|
||||||
this.searchStore.add(this.searchStore.query)
|
}
|
||||||
},
|
},
|
||||||
searchItems() {
|
searchItems() {
|
||||||
return webapi.spotify().then(({ data }) => {
|
return webapi.spotify().then(({ data }) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user