<script setup lang="ts">
import { useRouter, useRoute } from 'vue-router';
import { app_ready, app_routes } from '~/store/app';
import { watch } from 'vue';

console.log('app_ready :>> ', app_ready.value);
const router = useRouter()

watch(
  () => app_ready.value,
  (val) => {
    if (val) {
      console.log('app_ready :>> ', sessionStorage.getItem('toRouteName'), app_routes.value?.[0]?.name);
      router.push({ name: sessionStorage.getItem('toRouteName') || app_routes.value?.[0]?.name })
    }
  },
  {
    immediate: true
  }
)


</script>

<template>
  <div :loading="true" class="w-screen h-screen"></div>
</template>
