fix: logout issue
This commit is contained in:
@@ -4,21 +4,15 @@ import { createApp } from 'vue'
|
||||
import router from './router'
|
||||
import App from './App.vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import dayjs from '@/utils/dayjs'
|
||||
import translationPlugin from './translation'
|
||||
import { usersStore } from './stores/user'
|
||||
import { sessionStore } from './stores/session'
|
||||
|
||||
import {
|
||||
FrappeUI,
|
||||
Button,
|
||||
setConfig,
|
||||
frappeRequest,
|
||||
resourcesPlugin,
|
||||
} from 'frappe-ui'
|
||||
import { FrappeUI, setConfig, frappeRequest, resourcesPlugin } from 'frappe-ui'
|
||||
|
||||
// create a pinia instance
|
||||
let pinia = createPinia()
|
||||
|
||||
let app = createApp(App)
|
||||
|
||||
setConfig('resourceFetcher', frappeRequest)
|
||||
|
||||
app.use(FrappeUI)
|
||||
@@ -26,6 +20,16 @@ app.use(pinia)
|
||||
app.use(router)
|
||||
app.use(resourcesPlugin)
|
||||
app.use(translationPlugin)
|
||||
app.provide('$dayjs', dayjs)
|
||||
|
||||
app.component('Button', Button)
|
||||
app.mount('#app')
|
||||
|
||||
const { userResource } = usersStore()
|
||||
let { isLoggedIn } = sessionStore()
|
||||
|
||||
if (isLoggedIn) {
|
||||
await userResource.reload()
|
||||
}
|
||||
|
||||
app.provide('$user', userResource)
|
||||
app.config.globalProperties.$user = userResource
|
||||
|
||||
Reference in New Issue
Block a user