From 29ebda9b183edb6e441da85c416e29c67fe52e79 Mon Sep 17 00:00:00 2001 From: Edd Date: Mon, 26 Jan 2026 19:12:50 +0000 Subject: [PATCH] fix frontend bugs --- app/layouts/default.vue | 5 ----- app/pages/auth/login.vue | 3 +++ app/pages/index.vue | 14 ++++++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/layouts/default.vue b/app/layouts/default.vue index 644ff12..970fcdf 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -165,13 +165,11 @@ import { useAuthStore } from "~/stores/auth-store.js"; const authStore = useAuthStore(); const router = useRouter(); -// State const isDark = ref(false); const isUserMenuOpen = ref(false); const isMobileMenuOpen = ref(false); const userMenuRef = ref(null); -// Toggle Dark Mode function toggleDark() { isDark.value = !isDark.value; if (isDark.value) { @@ -183,7 +181,6 @@ function toggleDark() { } } -// Navigation Links const navLinks = [ { name: 'Profile', path: '/profile' }, ]; @@ -208,13 +205,11 @@ function closeDropdowns(event) { } onMounted(() => { - // Initialize Theme if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) { isDark.value = true; document.documentElement.classList.add('dark'); } - // Click listener for closing dropdowns window.addEventListener('click', closeDropdowns); }); diff --git a/app/pages/auth/login.vue b/app/pages/auth/login.vue index a7421da..cbf2a4e 100644 --- a/app/pages/auth/login.vue +++ b/app/pages/auth/login.vue @@ -53,6 +53,7 @@ import { useAuthStore } from "~/stores/auth-store.js"; import { storeToRefs } from "pinia"; +const notifications = useNotificationStore(); const config = useRuntimeConfig(); const api = config.public.apiBase; const authStore = useAuthStore(); @@ -94,8 +95,10 @@ async function handleLogin() { token.value = response._data.token; user.value = response._data.user; if (response._data.user.mustChangePassword === true) { + notifications.error("Please update your password."); router.push("/profile/update-password"); } else { + notifications.success("Logged in successfully!"); router.push("/"); } } diff --git a/app/pages/index.vue b/app/pages/index.vue index 0f7d005..ccbd4a4 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -64,8 +64,8 @@