fix user login page display

This commit is contained in:
isUnknown 2025-04-30 16:21:56 +02:00
parent de52c5e6be
commit 009752ff32
3 changed files with 15 additions and 8 deletions

View file

@ -1,10 +1,14 @@
import { defineStore, storeToRefs } from "pinia";
import { ref, computed } from "vue";
import { useProjectsStore } from "./projects";
import { defineStore, storeToRefs } from 'pinia';
import { ref, computed } from 'vue';
import { useProjectsStore } from './projects';
export const useUserStore = defineStore("user", () => {
export const useUserStore = defineStore('user', () => {
const user = ref(null);
const isLogged = computed(() => {
return user.value?.hasOwnProperty('role');
});
const { projects } = storeToRefs(useProjectsStore());
const notifications = computed(() => {
@ -22,7 +26,7 @@ export const useUserStore = defineStore("user", () => {
});
function readNotification(notificationId, projectId) {
console.log("Read notification", notificationId, projectId);
console.log('Read notification', notificationId, projectId);
projects.value = projects.value.map((project) => ({
...project,
notifications:
@ -57,6 +61,7 @@ export const useUserStore = defineStore("user", () => {
return {
user,
isLogged,
notifications,
readNotification,
readAllNotifications,