diff --git a/src/store/index.ts b/src/store/index.ts index 73f69b4..e320a1c 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -633,7 +633,7 @@ export const updateTemplate = async (id: string, updates: Partial) }; export const removeTemplate = async (id: string) => { - setStore("templates", (t) => t.filter(tmpl => tmpl.id !== id)); + setStore("templates", (t) => (t || []).filter(tmpl => tmpl.id !== id)); await syncPreferences(); };