diff --git a/src/routes/archive.index.tsx b/src/routes/archive.index.tsx index b5d8b1a..4830103 100644 --- a/src/routes/archive.index.tsx +++ b/src/routes/archive.index.tsx @@ -171,6 +171,10 @@ function ArchivePage() { }, [rows]); const deleteRow = async (id: string) => { + if (isLocked) { + toast.error("Tab is locked. Unlock it to delete records."); + return; + } if (!confirm("Delete this record?")) return; const { error } = await supabase.from("archive_records").delete().eq("id", id); if (error) { @@ -184,6 +188,10 @@ function ArchivePage() { const deleteAllInCategory = async () => { if (!activeCategory) return; + if (isLocked) { + toast.error("Tab is locked. Unlock it to clear records."); + return; + } if (!confirm(`Delete ALL ${totalCount} records in "${activeCategory.label}"? This cannot be undone.`)) return; const { error } = await supabase.from("archive_records").delete().eq("category_id", activeCategory.id); if (error) {