File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -32,14 +32,17 @@ const app = {
3232 }
3333 } ,
3434 actions : {
35- ToggleSideBar : ( { commit } ) => {
35+ ToggleSideBar ( { commit } ) {
3636 commit ( 'TOGGLE_SIDEBAR' )
3737 } ,
38- addVisitedViews : ( { commit } , view ) => {
38+ addVisitedViews ( { commit } , view ) {
3939 commit ( 'ADD_VISITED_VIEWS' , view )
4040 } ,
41- delVisitedViews : ( { commit } , view ) => {
42- commit ( 'DEL_VISITED_VIEWS' , view )
41+ delVisitedViews ( { commit, state } , view ) {
42+ return new Promise ( ( resolve ) => {
43+ commit ( 'DEL_VISITED_VIEWS' , view )
44+ resolve ( [ ...state . visitedViews ] )
45+ } )
4346 }
4447 }
4548}
Original file line number Diff line number Diff line change @@ -17,7 +17,11 @@ export default {
1717 },
1818 methods: {
1919 closeViewTabs (view , $event ) {
20- this .$store .dispatch (' delVisitedViews' , view)
20+ this .$store .dispatch (' delVisitedViews' , view).then ((views ) => {
21+ if (this .isActive (view .path )) {
22+ this .$router .push (views .pop ().path )
23+ }
24+ })
2125 $event .preventDefault ()
2226 },
2327 generateRoute () {
You can’t perform that action at this time.
0 commit comments