Skip to content

Feature/client logger #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Reverting accidental change to pages/home.vue
Signed-off-by: Mark Rivera <[email protected]>
  • Loading branch information
markcrivera committed Mar 19, 2025
commit 7d76fccddeac9abfe7d9bc4b7877fa7d49d824c6
50 changes: 9 additions & 41 deletions pages/home.vue
Original file line number Diff line number Diff line change
@@ -1,49 +1,17 @@
<template>
<div>
<div v-if="!isInitialized" class="flex h-screen items-center justify-center">
<p>Loading application data...</p>
<main class="">
<div class="mx-auto max-w-7xl px-4 pb-12 sm:px-6 lg:px-8">
<!-- Your content -->
<DashBoardItems />
</div>

<div v-else>
<main>
<div class="mx-auto max-w-7xl px-4 pb-12 sm:px-6 lg:px-8">
<DashBoardItems />
</div>
</main>
</div>
</div>
</main>
</template>

<script setup lang="ts">
import { ref, onMounted } from "vue";
import NavBar from "~/components/NavBar.vue";
import DashBoardItems from "~/components/DashBoardItems.vue";
import { useAliasStore } from "~~/stores/AliasStorage";
import { useAlertsStore } from "~~/stores/AlertsStore";
<script setup>
import { useTestStore } from "~~/stores/HeaderValues";
import { useRouter } from "vue-router";

const router = useRouter();
const isInitialized = ref(false);

const aliasStore = useAliasStore();
const alertsStore = useAlertsStore();
const testStore = useTestStore();

onMounted(async () => {
await aliasStore.loadAliases();

const currentUser = await $fetch("/api/auth/currentUser");
testStore.changeUsername(currentUser?.email || "Welcome to TIR");

if (currentUser && currentUser.id) {
alertsStore.startPolling(currentUser.id);
} else {
console.warn("No valid user found; alerts polling not started.");
}

isInitialized.value = true;
const store = useTestStore();

router.push("/dashboard");
onMounted(() => {
store.changeUsername("Welcome to TIR");
});
</script>