Newer
Older
bugtrail / packages / web / src / App.vue
<script setup lang="ts">
import { onMounted } from "vue";
import { GnToastProvider } from "gnexus-ui-kit/vue";
import { useAuth } from "./stores/auth";
import { useToast } from "gnexus-ui-kit/vue";

const auth = useAuth();
const toast = useToast();

onMounted(() => {
  if (!auth.user.value) {
    auth.fetch().catch(() => toast.error({ title: "Could not check your session" }));
  }
});
</script>

<template>
  <GnToastProvider>
    <RouterView />
  </GnToastProvider>
</template>