Alex krasn/bugfix on hotkeys when canvas not loaded yet (#664)

* fix: zoomIn keyboar shortcut for macOS

* fix: appId

* fix: error, handle not yet loaded canvas
This commit is contained in:
alex-krasn 2020-10-30 09:03:54 -07:00 коммит произвёл GitHub
Родитель 7166cdae57
Коммит b0404c6276
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -501,7 +501,7 @@ export default class EditorPage extends React.Component<IEditorPageProps, IEdito
*/
private handleTagHotKey = (event: KeyboardEvent): void => {
const tag = this.getTagFromKeyboardEvent(event);
const selection = this.canvas.current.getSelectedRegions();
const selection = this.canvas?.current?.getSelectedRegions();
if (tag && selection.length) {
const { format, type, documentCount, name } = tag;