refs #985 Move close suggest logic to vuex
This commit is contained in:
parent
2c50d0f744
commit
2a337dc4cf
|
@ -207,13 +207,8 @@ export default {
|
|||
},
|
||||
closeSuggest() {
|
||||
if (this.openSuggest) {
|
||||
this.$store.commit('TimelineSpace/Modals/NewToot/Status/changeOpenSuggest', false)
|
||||
this.$store.commit('TimelineSpace/Modals/NewToot/Status/changeStartIndex', null)
|
||||
this.$store.commit('TimelineSpace/Modals/NewToot/Status/changeMatchWord', null)
|
||||
this.$store.commit('TimelineSpace/Modals/NewToot/Status/closeSuggest')
|
||||
this.highlightedIndex = 0
|
||||
this.$store.commit('TimelineSpace/Modals/NewToot/Status/clearFilteredSuggestion')
|
||||
this.$store.commit('TimelineSpace/Modals/NewToot/Status/clearFilteredAccounts')
|
||||
this.$store.commit('TimelineSpace/Modals/NewToot/Status/clearFilteredHashtags')
|
||||
}
|
||||
},
|
||||
suggestHighlight(index) {
|
||||
|
|
|
@ -141,6 +141,14 @@ const actions: ActionTree<StatusState, RootState> = {
|
|||
return res.data.hashtags
|
||||
}
|
||||
await Promise.all([searchCache(), searchAPI()])
|
||||
},
|
||||
closeSuggest: ({ commit }) => {
|
||||
commit(MUTATION_TYPES.CHANGE_OPEN_SUGGEST, false)
|
||||
commit(MUTATION_TYPES.CHANGE_START_INDEX, null)
|
||||
commit(MUTATION_TYPES.CHANGE_MATCH_WORD, null)
|
||||
commit(MUTATION_TYPES.CLEAR_FILTERED_SUGGESTION)
|
||||
commit(MUTATION_TYPES.CLEAR_FILTERED_ACCOUNTS)
|
||||
commit(MUTATION_TYPES.CLEAR_FILTERED_HASHTAGS)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue