mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 23:56:36 +08:00
fix: delete block leftMenu not delete (#472)
This commit is contained in:
@@ -46,12 +46,14 @@ export class BlockCommands {
|
||||
*
|
||||
* remove block by block id
|
||||
* @param {string} blockId
|
||||
* @param onDelete Delete Block's LeftMenuDraggable
|
||||
* @memberof BlockCommands
|
||||
*/
|
||||
public async removeBlock(blockId: string) {
|
||||
public async removeBlock(blockId: string, onDelete?: () => void) {
|
||||
const block = await this._editor.getBlockById(blockId);
|
||||
if (block) {
|
||||
block.remove();
|
||||
onDelete();
|
||||
await block.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user