File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import Cookies from 'js-cookie'
3
3
const app = {
4
4
state : {
5
5
sidebar : {
6
- opened : ! + Cookies . get ( 'sidebarStatus' ) ,
6
+ opened : Cookies . get ( 'sidebarStatus' ) ? ! ! + Cookies . get ( 'sidebarStatus' ) : true ,
7
7
withoutAnimation : false
8
8
} ,
9
9
device : 'desktop' ,
@@ -12,16 +12,16 @@ const app = {
12
12
} ,
13
13
mutations : {
14
14
TOGGLE_SIDEBAR : state => {
15
+ state . sidebar . opened = ! state . sidebar . opened
16
+ state . sidebar . withoutAnimation = false
15
17
if ( state . sidebar . opened ) {
16
18
Cookies . set ( 'sidebarStatus' , 1 )
17
19
} else {
18
20
Cookies . set ( 'sidebarStatus' , 0 )
19
21
}
20
- state . sidebar . opened = ! state . sidebar . opened
21
- state . sidebar . withoutAnimation = false
22
22
} ,
23
23
CLOSE_SIDEBAR : ( state , withoutAnimation ) => {
24
- Cookies . set ( 'sidebarStatus' , 1 )
24
+ Cookies . set ( 'sidebarStatus' , 0 )
25
25
state . sidebar . opened = false
26
26
state . sidebar . withoutAnimation = withoutAnimation
27
27
} ,
You can’t perform that action at this time.
0 commit comments