Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix(store): clear selected element after element deletion
Browse files Browse the repository at this point in the history
fix #58
  • Loading branch information
Lasse Küchler committed Dec 16, 2017
1 parent 2c1d6ee commit 5a21e46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/electron/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export function createMenu(store: Store): void {
const selectedElement: PageElement | undefined = store.getSelectedElement();
if (selectedElement) {
selectedElement.remove();
store.setSelectedElement(undefined);
} else {
Menu.sendActionToFirstResponder('Backspace');
}
Expand Down
2 changes: 1 addition & 1 deletion src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export class Store {
this.rearrangeElement = rearrangeElement;
}

public setSelectedElement(selectedElement: PageElement): void {
public setSelectedElement(selectedElement: PageElement | undefined): void {
this.selectedElement = selectedElement;
}

Expand Down

0 comments on commit 5a21e46

Please sign in to comment.