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

@@ -10,9 +10,8 @@
<script setup>
import { FrappeUIProvider } from 'frappe-ui'
import { Dialogs } from '@/utils/dialogs'
import { computed, onUnmounted, ref, watch } from 'vue'
import { computed, onUnmounted, ref } from 'vue'
import { useScreenSize } from './utils/composables'
import { usersStore } from '@/stores/user'
import { useSettings } from '@/stores/settings'
import { useRouter } from 'vue-router'
import DesktopLayout from './components/DesktopLayout.vue'
@@ -23,7 +22,6 @@ import InstallPrompt from './components/InstallPrompt.vue'
const { isMobile } = useScreenSize()
const router = useRouter()
const noSidebar = ref(false)
const { userResource } = usersStore()
const { settings } = useSettings()
router.beforeEach((to, from, next) => {

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