fix: guard contre les projets avec un mauvais template Kirby
All checks were successful
Deploy Preprod / Build and Deploy to Preprod (push) Successful in 32s

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 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-03-03 17:18:50 +01:00
parent 6896e558ab
commit 059fb0e5b0
2 changed files with 5 additions and 1 deletions

View file

@ -21,6 +21,7 @@
</hgroup>
<img :src="project.logo" alt="Logo" class="project-logo | rounded-sm" />
<ol
v-if="Array.isArray(project.steps)"
class="project-steps"
:data-steps="project.steps.length"
:style="'--steps:' + project.steps.length"

View file

@ -19,7 +19,10 @@ export const useUserStore = defineStore('user', () => {
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,