fix: enable pulse only for logged in users
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user