|
@@ -1,12 +1,15 @@
|
|
|
import Cookies from 'js-cookie'
|
|
|
|
|
|
+const sidebarStatusCookiesKey = process.env.VUE_APP_PROJECT_KEY + '-sidebarStatus'
|
|
|
+const sizeCookiesKey = process.env.VUE_APP_PROJECT_KEY + '-size'
|
|
|
+
|
|
|
const state = {
|
|
|
sidebar: {
|
|
|
- opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
|
|
|
+ opened: Cookies.get(sidebarStatusCookiesKey) ? !!+Cookies.get(sidebarStatusCookiesKey) : true,
|
|
|
withoutAnimation: false
|
|
|
},
|
|
|
device: 'desktop',
|
|
|
- size: Cookies.get('size') || 'medium'
|
|
|
+ size: Cookies.get(sizeCookiesKey) || 'medium'
|
|
|
}
|
|
|
|
|
|
const mutations = {
|
|
@@ -14,13 +17,13 @@ const mutations = {
|
|
|
state.sidebar.opened = !state.sidebar.opened
|
|
|
state.sidebar.withoutAnimation = false
|
|
|
if (state.sidebar.opened) {
|
|
|
- Cookies.set('sidebarStatus', 1)
|
|
|
+ Cookies.set(sidebarStatusCookiesKey, 1)
|
|
|
} else {
|
|
|
- Cookies.set('sidebarStatus', 0)
|
|
|
+ Cookies.set(sidebarStatusCookiesKey, 0)
|
|
|
}
|
|
|
},
|
|
|
CLOSE_SIDEBAR: (state, withoutAnimation) => {
|
|
|
- Cookies.set('sidebarStatus', 0)
|
|
|
+ Cookies.set(sidebarStatusCookiesKey, 0)
|
|
|
state.sidebar.opened = false
|
|
|
state.sidebar.withoutAnimation = withoutAnimation
|
|
|
},
|
|
@@ -29,7 +32,7 @@ const mutations = {
|
|
|
},
|
|
|
SET_SIZE: (state, size) => {
|
|
|
state.size = size
|
|
|
- Cookies.set('size', size)
|
|
|
+ Cookies.set(sizeCookiesKey, size)
|
|
|
}
|
|
|
}
|
|
|
|