Fixed categories not updating

This commit is contained in:
Alexis
2025-04-15 11:18:26 +02:00
parent f00e049f76
commit c25c10f7b7
3 changed files with 8 additions and 12 deletions

View File

@@ -918,11 +918,10 @@ export const useCalendar = defineStore("calendar", () => {
*/
function updateAllEventsCategories(categories: Category[]) {
baseEvents.value.forEach((event) => {
if (event.category?.id) {
const category = categories.find((c) => c.id === event.category?.id)
if (category) {
event.category = category
}
const category = categories.find((c) => c.id === event.category?.id)
if (category && event.category?.id) {
event.category = category
}
})
}