From 059fb0e5b0823857e75ac8628948441751cca84c Mon Sep 17 00:00:00 2001 From: isUnknown Date: Tue, 3 Mar 2026 17:18:50 +0100 Subject: [PATCH] fix: guard contre les projets avec un mauvais template Kirby MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Projets utilisant default.txt au lieu de project.txt retournent des Field objects au lieu de tableaux pour steps et notifications. Ajout de Array.isArray() pour éviter que ces projets cassent l'ensemble des notifications, avec console.error pour les identifier. Co-Authored-By: Claude Sonnet 4.6 --- src/components/project/Project.vue | 1 + src/stores/user.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/project/Project.vue b/src/components/project/Project.vue index 7d048e3..3dfaef3 100644 --- a/src/components/project/Project.vue +++ b/src/components/project/Project.vue @@ -21,6 +21,7 @@
    { if (!projects.value || !user.value) return []; return projects.value.flatMap((project) => { - if (!project.notifications) return []; + if (!Array.isArray(project.notifications)) { + if (project.notifications) console.error(`[Notifications] project.notifications n'est pas un tableau pour "${project.slug}"`, project.notifications); + return []; + } return project.notifications.map((notification) => ({ ...notification,