analytics: keyboard shortcut

This commit is contained in:
Radium Zheng 2018-07-19 08:21:05 +10:00
parent cc38fcc5d0
commit 8ebf2b7e47
1 changed files with 7 additions and 9 deletions

View File

@ -1,5 +1,6 @@
/* @flow */
import { createShortcutEvent, sendAnalytics } from '../analytics';
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
import { CONFERENCE_JOINED } from '../base/conference';
import { toggleDialog } from '../base/dialog';
@ -36,27 +37,24 @@ MiddlewareRegistry.register(({ getState, dispatch }) => next => action => {
}
};
recordingController.onWarning = function(messageKey, messageParams) {
recordingController.onWarning = (messageKey, messageParams) => {
dispatch(showNotification({
title: i18next.t('localRecording.localRecording'),
description: i18next.t(messageKey, messageParams)
}, 10000));
};
recordingController.onNotify = function(messageKey, messageParams) {
recordingController.onNotify = (messageKey, messageParams) => {
dispatch(showNotification({
title: i18next.t('localRecording.localRecording'),
description: i18next.t(messageKey, messageParams)
}, 10000));
};
// register shortcut
APP.keyboardshortcut.registerShortcut(
'L',
null,
() => dispatch(toggleDialog(LocalRecordingInfoDialog)),
'keyboardShortcuts.localRecording'
);
APP.keyboardshortcut.registerShortcut('L', null, () => {
sendAnalytics(createShortcutEvent('local.recording'));
dispatch(toggleDialog(LocalRecordingInfoDialog));
}, 'keyboardShortcuts.localRecording');
break;
case APP_WILL_UNMOUNT:
recordingController.onStateChanged = null;