27 lines
587 B
JavaScript
27 lines
587 B
JavaScript
import { createApp } from 'vue'
|
|
import { createPinia } from 'pinia'
|
|
import App from './App.vue'
|
|
import router from './router/index.js'
|
|
import { initDatabase } from './db/database.js'
|
|
import { syncEngine } from './db/sync.js'
|
|
import { useAuthStore } from './stores/auth.js'
|
|
import './assets/css/main.css'
|
|
|
|
const app = createApp(App)
|
|
const pinia = createPinia()
|
|
|
|
app.use(pinia)
|
|
app.use(router)
|
|
|
|
const auth = useAuthStore()
|
|
|
|
async function bootstrap() {
|
|
if (auth.isAuthenticated) {
|
|
await initDatabase()
|
|
syncEngine.fullSync().catch(() => {})
|
|
}
|
|
app.mount('#app')
|
|
}
|
|
|
|
bootstrap()
|