Skip to content

Commit 50dcb90

Browse files
committed
fix[tagsView]: fixed DEL_OTHERS_CACHED_VIEWS bug
1 parent ed0b023 commit 50dcb90

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/store/modules/tagsView.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ const mutations = {
3939
},
4040
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
4141
const index = state.cachedViews.indexOf(view.name)
42-
index > -1 && (state.cachedViews = state.cachedViews.slice(index, index + 1))
42+
if (index > -1) {
43+
state.cachedViews = state.cachedViews.slice(index, index + 1)
44+
} else {
45+
// if index = -1, there is no cached tags
46+
state.cachedViews = []
47+
}
4348
},
4449

4550
DEL_ALL_VISITED_VIEWS: state => {

0 commit comments

Comments
 (0)