Compare commits

...

2 Commits

Author SHA1 Message Date
af16c2470f Use selected channel in search 2021-06-01 00:05:10 +02:00
d07c2ae942 Focus search query input 2021-05-31 23:58:55 +02:00
2 changed files with 7 additions and 3 deletions

View File

@ -43,7 +43,7 @@ export default {
watch: { watch: {
isOpen(val) { isOpen(val) {
if (val) { if (val) {
this.$refs.query.focus() this.$nextTick(() => this.$refs.query.focus())
} }
} }
}, },

View File

@ -260,8 +260,12 @@ export default new Vuex.Store({
closeSearch({commit}) { closeSearch({commit}) {
commit('setSearchPopupState', false) commit('setSearchPopupState', false)
}, },
startQuery({commit}, query) { startQuery({state, commit}, query) {
fetch(this.state.microsubEndpoint + '?action=search&channel=global&query='+query, { let channel = 'global'
if (state.channel.uid !== null) {
channel = state.channel.uid
}
fetch(this.state.microsubEndpoint + '?action=search&channel='+channel+'&query='+query, {
headers: { headers: {
'Authorization': 'Bearer ' + this.state.access_token 'Authorization': 'Bearer ' + this.state.access_token
}, },