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