Skip to content

Commit

Permalink
Fix: navigator: filter is cleared on directory reload
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksey-hoffman committed Aug 7, 2022
1 parent da58ac3 commit 1a51ada
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/components/Workspace/Areas/Navigator/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export default {
WorkspaceAreaSortingToolbar,
WorkspaceAreaItemList,
},
data () {
return {
}
watch: {
'currentDir.path' () {
this.$store.dispatch('clearFilterField', 'navigator')
},
},
async mounted () {
this.$nextTick(() => {
Expand All @@ -46,6 +47,7 @@ export default {
...mapFields({
navigatorRouteIsLoaded: 'navigatorRouteIsLoaded',
filterQuery: 'filterField.view.navigator.query',
currentDir: 'navigatorView.currentDir',
}),
},
}
Expand Down
5 changes: 2 additions & 3 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -3151,9 +3151,9 @@ export default new Vuex.Store({
value: state.storageData.workspaces.items
})
},
CLEAR_FILTER_FIELD ({ state, commit, dispatch, getters }) {
clearFilterField ({dispatch}, routeName) {
dispatch('SET', {
key: `filterField.view.${router.history.current.name}.query`,
key: `filterField.view.${routeName}.query`,
value: ''
})
},
Expand All @@ -3179,7 +3179,6 @@ export default new Vuex.Store({

store.dispatch('SET_NAVIGATOR_STATE')
store.dispatch('LOAD_ROUTE', 'navigator')
store.dispatch('CLEAR_FILTER_FIELD')
let {dirInfo} = await store.dispatch('LOAD_DIR_ITEMS', options)
eventHub.$emit('app:method', {
method: 'postDirWatcherWorker',
Expand Down

0 comments on commit 1a51ada

Please sign in to comment.