diff --git a/src/runtime/components/CommandPalette.vue b/src/runtime/components/CommandPalette.vue index 83e0023b..1cc4f37d 100644 --- a/src/runtime/components/CommandPalette.vue +++ b/src/runtime/components/CommandPalette.vue @@ -180,7 +180,7 @@ const groups = computed(() => { } acc[item.group] ||= [] - acc[item.group].push({ ...item, matches }) + acc[item.group]?.push({ ...item, matches }) return acc }, {} as Record['matches'] })[]>) diff --git a/src/runtime/composables/useToast.ts b/src/runtime/composables/useToast.ts index feb139ed..d1080d4e 100644 --- a/src/runtime/composables/useToast.ts +++ b/src/runtime/composables/useToast.ts @@ -26,11 +26,11 @@ export function useToast() { return body } - function update(id: string | number, toast: Partial) { + function update(id: string | number, toast: Omit, "id">) { const index = toasts.value.findIndex((t: Toast) => t.id === id) if (index !== -1) { toasts.value[index] = { - ...toasts.value[index], + ...toasts.value[index] as Toast, ...toast } } @@ -40,7 +40,7 @@ export function useToast() { const index = toasts.value.findIndex((t: Toast) => t.id === id) if (index !== -1) { toasts.value[index] = { - ...toasts.value[index], + ...toasts.value[index] as Toast, open: false } }