fix: moved isSidebarCollapsed value to globalStore
This commit is contained in:
parent
a5071a1be2
commit
fe047ace93
@ -94,12 +94,16 @@ import NotificationsIcon from '@/components/Icons/NotificationsIcon.vue'
|
|||||||
import SidebarLink from '@/components/SidebarLink.vue'
|
import SidebarLink from '@/components/SidebarLink.vue'
|
||||||
import { viewsStore } from '@/stores/views'
|
import { viewsStore } from '@/stores/views'
|
||||||
import { notificationsStore } from '@/stores/notifications'
|
import { notificationsStore } from '@/stores/notifications'
|
||||||
import { useStorage } from '@vueuse/core'
|
import { globalStore } from '@/stores/global'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
const { getPinnedViews, getPublicViews } = viewsStore()
|
const { getPinnedViews, getPublicViews } = viewsStore()
|
||||||
const { toggle: toggleNotificationPanel } = notificationsStore()
|
const { toggle: toggleNotificationPanel } = notificationsStore()
|
||||||
const isSidebarCollapsed = useStorage('sidebar_is_collapsed', false)
|
|
||||||
|
const isSidebarCollapsed = computed({
|
||||||
|
get: () => globalStore().isSidebarCollapsed,
|
||||||
|
set: (value) => globalStore().setIsSidebarCollapsed(value),
|
||||||
|
})
|
||||||
|
|
||||||
const links = [
|
const links = [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { useStorage } from '@vueuse/core'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { getCurrentInstance, ref } from 'vue'
|
import { getCurrentInstance, ref } from 'vue'
|
||||||
|
|
||||||
@ -6,6 +7,7 @@ export const globalStore = defineStore('crm-global', () => {
|
|||||||
const { $dialog } = app.appContext.config.globalProperties
|
const { $dialog } = app.appContext.config.globalProperties
|
||||||
|
|
||||||
let twilioEnabled = ref(false)
|
let twilioEnabled = ref(false)
|
||||||
|
let isSidebarCollapsed = useStorage('isSidebarCollapsed', false)
|
||||||
let callMethod = () => {}
|
let callMethod = () => {}
|
||||||
|
|
||||||
function setTwilioEnabled(value) {
|
function setTwilioEnabled(value) {
|
||||||
@ -20,9 +22,15 @@ export const globalStore = defineStore('crm-global', () => {
|
|||||||
callMethod(number)
|
callMethod(number)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setIsSidebarCollapsed(value) {
|
||||||
|
isSidebarCollapsed.value = value
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
$dialog,
|
$dialog,
|
||||||
twilioEnabled,
|
twilioEnabled,
|
||||||
|
isSidebarCollapsed,
|
||||||
|
setIsSidebarCollapsed,
|
||||||
makeCall,
|
makeCall,
|
||||||
setTwilioEnabled,
|
setTwilioEnabled,
|
||||||
setMakeCall,
|
setMakeCall,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user