ff-admin/src/App.vue
Julian Krauser b1dbb806c6 slidein notification
show error message to user
2024-12-19 11:16:05 +01:00

40 lines
1.1 KiB
Vue

<template>
<Modal />
<ContextMenu />
<Header @contextmenu.prevent />
<div class="grow overflow-x-hidden overflow-y-auto p-2 md:p-4" @contextmenu.prevent>
<RouterView />
</div>
<Footer @contextmenu.prevent />
<Notification />
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { RouterView } from "vue-router";
import Header from "./components/Header.vue";
import Footer from "./components/Footer.vue";
import { mapState } from "pinia";
import { useAuthStore } from "./stores/auth";
import { isAuthenticatedPromise } from "./router/authGuard";
import ContextMenu from "./components/ContextMenu.vue";
import Modal from "./components/Modal.vue";
import Notification from "./components/Notification.vue";
</script>
<script lang="ts">
export default defineComponent({
computed: {
...mapState(useAuthStore, ["authCheck"]),
},
mounted() {
if (!this.authCheck && localStorage.getItem("access_token")) {
isAuthenticatedPromise().catch(() => {
localStorage.removeItem("access_token");
localStorage.removeItem("refresh_token");
});
}
},
});
</script>