fix: enable pulse only for logged in users

This commit is contained in:
Jannat Patel
2026-01-20 16:52:42 +05:30
parent d507479bda
commit 9987ea1db6
2 changed files with 8 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
import './index.css'
import { createApp } from 'vue'
import { createApp, watch } from 'vue'
import router from './router'
import App from './App.vue'
import { createPinia } from 'pinia'
@@ -19,7 +19,6 @@ app.use(FrappeUI)
app.use(pinia)
app.use(router)
app.use(translationPlugin)
app.use(telemetryPlugin, { app_name: 'lms' })
app.use(pageMetaPlugin)
app.provide('$dayjs', dayjs)
app.provide('$socket', initSocket())
@@ -29,5 +28,11 @@ const { userResource, allUsers } = usersStore()
app.provide('$user', userResource)
app.provide('$allUsers', allUsers)
watch(userResource, () => {
if (userResource.data) {
app.use(telemetryPlugin, { app_name: 'lms' })
}
})
app.config.globalProperties.$user = userResource
app.config.globalProperties.$dialog = createDialog