File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1190,7 +1190,7 @@ export default function ControlPanel({
1190
1190
title : t ( "clear" ) ,
1191
1191
message : t ( "are_you_sure_clear" ) ,
1192
1192
} ,
1193
- function : ( ) => {
1193
+ function : async ( ) => {
1194
1194
setTables ( [ ] ) ;
1195
1195
setRelationships ( [ ] ) ;
1196
1196
setAreas ( [ ] ) ;
@@ -1199,6 +1199,20 @@ export default function ControlPanel({
1199
1199
setTypes ( [ ] ) ;
1200
1200
setUndoStack ( [ ] ) ;
1201
1201
setRedoStack ( [ ] ) ;
1202
+
1203
+ if ( ! diagramId ) {
1204
+ console . error ( "Something went wrong." ) ;
1205
+ return ;
1206
+ }
1207
+
1208
+ db . table ( "diagrams" )
1209
+ . delete ( diagramId )
1210
+ . then ( ( ) => {
1211
+ console . info ( 'Deleted diagram successfully.' )
1212
+ } )
1213
+ . catch ( ( error ) => {
1214
+ console . error ( `Error deleting records with gistId '${ diagramId } ':` , error ) ;
1215
+ } ) ;
1202
1216
} ,
1203
1217
} ,
1204
1218
edit : {
You can’t perform that action at this time.
0 commit comments