Frontend refactor and additions

This commit is contained in:
Jesse Malotaux 2025-04-11 16:49:51 +02:00
parent 5de99b32cd
commit 2a9813e7ac
12 changed files with 195 additions and 26 deletions

View file

@ -18,7 +18,7 @@
<script setup>
import MainMenu from '@/components/base/MainMenu.vue'
import { onMounted, ref } from 'vue'
import { onMounted, onUpdated, ref } from 'vue'
import { RouterView, useRoute } from 'vue-router'
import { useDeviceStore } from './stores/device'
import { isLocal } from './services/ApiService'
@ -30,16 +30,20 @@ const route = useRoute()
const handshake = ref(false)
onMounted(async () => {
// Setting device uuid from localstorage
// If not present in LocalStorage a new uuidV4 will be generated
device.uuid()
const hsReq = await device.remoteHandshake()
handshake.value = hsReq
device.$subscribe((mutation, state) => {
console.log(mutation)
if (device.key()) handshake.value = true
})
// Setting device uuid from localstorage
// If not present in LocalStorage a new uuidV4 will be generated
})
onUpdated(() => {
console.log(device.key())
})
</script>