fix: moved sirebar settings to settings store

This commit is contained in:
Jannat Patel
2025-07-01 17:38:15 +05:30
parent 94cbbf169a
commit e526a6fd64
4 changed files with 12 additions and 9 deletions

View File

@@ -225,7 +225,7 @@ import {
IntermediateStepModal,
} from 'frappe-ui/frappe'
const { user, sidebarSettings } = sessionStore()
const { user } = sessionStore()
const { userResource } = usersStore()
let sidebarStore = useSidebar()
const socket = inject('$socket')
@@ -236,6 +236,7 @@ const isModerator = ref(false)
const isInstructor = ref(false)
const pageToEdit = ref(null)
const settingsStore = useSettings()
const { sidebarSettings } = settingsStore
const showOnboarding = ref(false)
const showIntermediateModal = ref(false)
const currentStep = ref({})

View File

@@ -58,11 +58,13 @@ import { getSidebarLinks } from '@/utils'
import { useRouter } from 'vue-router'
import { watch, ref, onMounted } from 'vue'
import { sessionStore } from '@/stores/session'
import { useSettings } from '@/stores/settings'
import { usersStore } from '@/stores/user'
import * as icons from 'lucide-vue-next'
const { logout, user, sidebarSettings } = sessionStore()
const { logout, user } = sessionStore()
let { isLoggedIn } = sessionStore()
const { sidebarSettings } = useSettings()
const router = useRouter()
let { userResource } = usersStore()
const sidebarLinks = ref(getSidebarLinks())

View File

@@ -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({
url: 'frappe.client.get_single_value',
params: {
@@ -77,7 +71,6 @@ export const sessionStore = defineStore('lms-session', () => {
logout,
brand,
branding,
sidebarSettings,
livecodeURL,
}
})

View File

@@ -29,11 +29,18 @@ export const useSettings = defineStore('settings', () => {
cache: ['preventSkippingVideos'],
})
const sidebarSettings = createResource({
url: 'lms.lms.api.get_sidebar_settings',
cache: 'Sidebar Settings',
auto: false,
})
return {
isSettingsOpen,
activeTab,
learningPaths,
allowGuestAccess,
preventSkippingVideos,
sidebarSettings,
}
})