add guard before APP in middleware.js

This commit is contained in:
Radium Zheng 2018-08-01 11:43:56 +10:00
parent 5a051024e6
commit 0410af9e5e
1 changed files with 5 additions and 4 deletions

View File

@ -64,10 +64,11 @@ isFeatureEnabled
}, 10000));
};
APP.keyboardshortcut.registerShortcut('L', null, () => {
sendAnalytics(createShortcutEvent('local.recording'));
dispatch(toggleDialog(LocalRecordingInfoDialog));
}, 'keyboardShortcuts.localRecording');
typeof APP === 'object' && typeof APP.keyboardshortcut === 'object'
&& APP.keyboardshortcut.registerShortcut('L', null, () => {
sendAnalytics(createShortcutEvent('local.recording'));
dispatch(toggleDialog(LocalRecordingInfoDialog));
}, 'keyboardShortcuts.localRecording');
break;
case APP_WILL_UNMOUNT:
recordingController.onStateChanged = null;