fix: moved sirebar settings to settings store
This commit is contained in:
@@ -225,7 +225,7 @@ import {
|
|||||||
IntermediateStepModal,
|
IntermediateStepModal,
|
||||||
} from 'frappe-ui/frappe'
|
} from 'frappe-ui/frappe'
|
||||||
|
|
||||||
const { user, sidebarSettings } = sessionStore()
|
const { user } = sessionStore()
|
||||||
const { userResource } = usersStore()
|
const { userResource } = usersStore()
|
||||||
let sidebarStore = useSidebar()
|
let sidebarStore = useSidebar()
|
||||||
const socket = inject('$socket')
|
const socket = inject('$socket')
|
||||||
@@ -236,6 +236,7 @@ const isModerator = ref(false)
|
|||||||
const isInstructor = ref(false)
|
const isInstructor = ref(false)
|
||||||
const pageToEdit = ref(null)
|
const pageToEdit = ref(null)
|
||||||
const settingsStore = useSettings()
|
const settingsStore = useSettings()
|
||||||
|
const { sidebarSettings } = settingsStore
|
||||||
const showOnboarding = ref(false)
|
const showOnboarding = ref(false)
|
||||||
const showIntermediateModal = ref(false)
|
const showIntermediateModal = ref(false)
|
||||||
const currentStep = ref({})
|
const currentStep = ref({})
|
||||||
|
|||||||
@@ -58,11 +58,13 @@ import { getSidebarLinks } from '@/utils'
|
|||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { watch, ref, onMounted } from 'vue'
|
import { watch, ref, onMounted } from 'vue'
|
||||||
import { sessionStore } from '@/stores/session'
|
import { sessionStore } from '@/stores/session'
|
||||||
|
import { useSettings } from '@/stores/settings'
|
||||||
import { usersStore } from '@/stores/user'
|
import { usersStore } from '@/stores/user'
|
||||||
import * as icons from 'lucide-vue-next'
|
import * as icons from 'lucide-vue-next'
|
||||||
|
|
||||||
const { logout, user, sidebarSettings } = sessionStore()
|
const { logout, user } = sessionStore()
|
||||||
let { isLoggedIn } = sessionStore()
|
let { isLoggedIn } = sessionStore()
|
||||||
|
const { sidebarSettings } = useSettings()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
let { userResource } = usersStore()
|
let { userResource } = usersStore()
|
||||||
const sidebarLinks = ref(getSidebarLinks())
|
const sidebarLinks = ref(getSidebarLinks())
|
||||||
|
|||||||
@@ -54,12 +54,6 @@ export const sessionStore = defineStore('lms-session', () => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const sidebarSettings = createResource({
|
|
||||||
url: 'lms.lms.api.get_sidebar_settings',
|
|
||||||
cache: 'Sidebar Settings',
|
|
||||||
auto: false,
|
|
||||||
})
|
|
||||||
|
|
||||||
const livecodeURL = createResource({
|
const livecodeURL = createResource({
|
||||||
url: 'frappe.client.get_single_value',
|
url: 'frappe.client.get_single_value',
|
||||||
params: {
|
params: {
|
||||||
@@ -77,7 +71,6 @@ export const sessionStore = defineStore('lms-session', () => {
|
|||||||
logout,
|
logout,
|
||||||
brand,
|
brand,
|
||||||
branding,
|
branding,
|
||||||
sidebarSettings,
|
|
||||||
livecodeURL,
|
livecodeURL,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -29,11 +29,18 @@ export const useSettings = defineStore('settings', () => {
|
|||||||
cache: ['preventSkippingVideos'],
|
cache: ['preventSkippingVideos'],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const sidebarSettings = createResource({
|
||||||
|
url: 'lms.lms.api.get_sidebar_settings',
|
||||||
|
cache: 'Sidebar Settings',
|
||||||
|
auto: false,
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isSettingsOpen,
|
isSettingsOpen,
|
||||||
activeTab,
|
activeTab,
|
||||||
learningPaths,
|
learningPaths,
|
||||||
allowGuestAccess,
|
allowGuestAccess,
|
||||||
preventSkippingVideos,
|
preventSkippingVideos,
|
||||||
|
sidebarSettings,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user