fixed clear bug

This commit is contained in:
sudhirVoid 2024-12-13 14:56:56 +05:30
parent cb9e49b74c
commit 3c62e441f2

View File

@ -1110,7 +1110,7 @@ export default function ControlPanel({
title: t("clear"), title: t("clear"),
message: t("are_you_sure_clear"), message: t("are_you_sure_clear"),
}, },
function: () => { function: async () => {
setTables([]); setTables([]);
setRelationships([]); setRelationships([]);
setAreas([]); setAreas([]);
@ -1119,6 +1119,20 @@ export default function ControlPanel({
setTypes([]); setTypes([]);
setUndoStack([]); setUndoStack([]);
setRedoStack([]); setRedoStack([]);
if (!diagramId) {
console.error("Something went wrong.");
return;
}
db.table("diagrams")
.delete(diagramId)
.then(() => {
console.info('Deleted diagram successfully.')
})
.catch((error) => {
console.error(`Error deleting records with gistId '${diagramId}':`, error);
});
}, },
}, },
edit: { edit: {