more typescript changes/conversion nonsense (this broke a lot of stuff)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<script setup>
|
||||
<script setup lang="ts">
|
||||
import { RouterLink, RouterView } from 'vue-router';
|
||||
import Separator from './components/ui/separator/Separator.vue';
|
||||
import Button from './components/ui/button/Button.vue';
|
||||
@@ -14,7 +14,7 @@ import { useUserStore } from './stores/user';
|
||||
import Alert from './components/ui/alert/Alert.vue';
|
||||
import AlertDescription from './components/ui/alert/AlertDescription.vue';
|
||||
|
||||
const userStore = useUserStore();
|
||||
let userStore = useUserStore();
|
||||
|
||||
// onMounted(async () => {
|
||||
// const res = await fetch(`${import.meta.env.VITE_APIHOST}/members/me`, {
|
||||
@@ -96,7 +96,7 @@ function formatDate(dateStr) {
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<DropdownMenu v-if="userStore.isLoggedIn">
|
||||
<DropdownMenu v-if="userStore?.isLoggedIn">
|
||||
<DropdownMenuTrigger class="cursor-pointer">
|
||||
<p>{{ userStore.user.name }}</p>
|
||||
</DropdownMenuTrigger>
|
||||
@@ -116,7 +116,7 @@ function formatDate(dateStr) {
|
||||
</div>
|
||||
</div>
|
||||
<Separator></Separator>
|
||||
<Alert v-if="userStore.user?.loa?.[0]" class="m-2 mx-auto w-5xl" variant="info">
|
||||
<Alert v-if="userStore?.user?.loa?.[0]" class="m-2 mx-auto w-5xl" variant="info">
|
||||
<AlertDescription class="flex flex-row items-center text-nowrap gap-5 mx-auto">
|
||||
<p>You are on LOA until <strong>{{ formatDate(userStore.user?.loa?.[0].end_date) }}</strong></p>
|
||||
<Button variant="secondary">End LOA</Button>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import router from './router/index'
|
||||
import FormCheckbox from './components/form/FormCheckbox.vue'
|
||||
import FormInput from './components/form/FormInput.vue'
|
||||
|
||||
@@ -47,12 +47,12 @@ router.beforeEach(async (to) => {
|
||||
}
|
||||
|
||||
// Not logged in
|
||||
if (to.meta.requiresAuth && !user.isLoggedIn) {
|
||||
// Redirect back to original page after login
|
||||
const redirectUrl = encodeURIComponent(window.location.origin + to.fullPath)
|
||||
window.location.href = `https://aj17thdevapi.nexuszone.net/login?redirect=${redirectUrl}`
|
||||
return false // Prevent Vue Router from continuing
|
||||
}
|
||||
// if (to.meta.requiresAuth && !user.isLoggedIn) {
|
||||
// // Redirect back to original page after login
|
||||
// const redirectUrl = encodeURIComponent(window.location.origin + to.fullPath)
|
||||
// window.location.href = `https://aj17thdevapi.nexuszone.net/login?redirect=${redirectUrl}`
|
||||
// return false // Prevent Vue Router from continuing
|
||||
// }
|
||||
|
||||
|
||||
// // Must be a member
|
||||
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"types": ["vite/client"],
|
||||
"paths": {
|
||||
"@/*": ["./src/*"],
|
||||
"@shared/*": ["../shared/*"]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
import path from 'node:path'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
@@ -15,7 +16,8 @@ export default defineConfig({
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
'@shared': path.resolve(__dirname, '../shared/*')
|
||||
},
|
||||
},
|
||||
server: {
|
||||
Reference in New Issue
Block a user