editor: add missing null checks

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/900/head
Varun Patil 2023-10-29 22:14:06 -07:00
parent f0c7cf7542
commit 3e40a3e5d2
1 changed files with 3 additions and 3 deletions

View File

@ -345,20 +345,20 @@ export default defineComponent({
// ctrl + S = save
if (event.ctrlKey && event.key === 's') {
event.preventDefault();
(document.querySelector('.FIE_topbar-save-button') as HTMLElement).click();
(document.querySelector('.FIE_topbar-save-button') as HTMLElement)?.click();
}
// ctrl + Z = undo
if (event.ctrlKey && event.key === 'z') {
event.preventDefault();
(document.querySelector('.FIE_topbar-undo-button') as HTMLElement).click();
(document.querySelector('.FIE_topbar-undo-button') as HTMLElement)?.click();
}
},
close() {
// Since we cannot call the closeMethod and know if there
// are unsaved changes, let's fake a close button trigger.
(document.querySelector('.FIE_topbar-close-button') as HTMLElement).click();
(document.querySelector('.FIE_topbar-close-button') as HTMLElement)?.click();
},
},
});