move clientId init to index.html, make zoom events only exist when they actually do something

This commit is contained in:
Zutatensuppe 2021-05-13 23:38:36 +02:00
parent a0118b0bdf
commit e9129cf049
7 changed files with 106 additions and 111 deletions

View file

@ -18,6 +18,15 @@
const res = await fetch(`/api/conf`)
const conf = await res.json()
function initme() {
let ID = localStorage.getItem('ID')
if (!ID) {
ID = Util.uniqId()
localStorage.setItem('ID', ID)
}
return ID
}
const router = VueRouter.createRouter({
history: VueRouter.createWebHashHistory(),
routes: [
@ -37,6 +46,7 @@
const app = Vue.createApp(App)
app.config.globalProperties.$config = conf
app.config.globalProperties.$clientId = initme()
app.use(router)
app.mount('#app')
})()