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 { viewsStore } from '@/stores/views'
|
||||
import { notificationsStore } from '@/stores/notifications'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { globalStore } from '@/stores/global'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const { getPinnedViews, getPublicViews } = viewsStore()
|
||||
const { toggle: toggleNotificationPanel } = notificationsStore()
|
||||
const isSidebarCollapsed = useStorage('sidebar_is_collapsed', false)
|
||||
|
||||
const isSidebarCollapsed = computed({
|
||||
get: () => globalStore().isSidebarCollapsed,
|
||||
set: (value) => globalStore().setIsSidebarCollapsed(value),
|
||||
})
|
||||
|
||||
const links = [
|
||||
{
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { defineStore } from 'pinia'
|
||||
import { getCurrentInstance, ref } from 'vue'
|
||||
|
||||
@ -6,6 +7,7 @@ export const globalStore = defineStore('crm-global', () => {
|
||||
const { $dialog } = app.appContext.config.globalProperties
|
||||
|
||||
let twilioEnabled = ref(false)
|
||||
let isSidebarCollapsed = useStorage('isSidebarCollapsed', false)
|
||||
let callMethod = () => {}
|
||||
|
||||
function setTwilioEnabled(value) {
|
||||
@ -20,9 +22,15 @@ export const globalStore = defineStore('crm-global', () => {
|
||||
callMethod(number)
|
||||
}
|
||||
|
||||
function setIsSidebarCollapsed(value) {
|
||||
isSidebarCollapsed.value = value
|
||||
}
|
||||
|
||||
return {
|
||||
$dialog,
|
||||
twilioEnabled,
|
||||
isSidebarCollapsed,
|
||||
setIsSidebarCollapsed,
|
||||
makeCall,
|
||||
setTwilioEnabled,
|
||||
setMakeCall,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user