Selaa lähdekoodia

analytics: keyboard shortcut

master
Radium Zheng 7 vuotta sitten
vanhempi
commit
8ebf2b7e47
1 muutettua tiedostoa jossa 7 lisäystä ja 9 poistoa
  1. 7
    9
      react/features/local-recording/middleware.js

+ 7
- 9
react/features/local-recording/middleware.js Näytä tiedosto

@@ -1,5 +1,6 @@
1 1
 /* @flow */
2 2
 
3
+import { createShortcutEvent, sendAnalytics } from '../analytics';
3 4
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
4 5
 import { CONFERENCE_JOINED } from '../base/conference';
5 6
 import { toggleDialog } from '../base/dialog';
@@ -36,27 +37,24 @@ MiddlewareRegistry.register(({ getState, dispatch }) => next => action => {
36 37
             }
37 38
         };
38 39
 
39
-        recordingController.onWarning = function(messageKey, messageParams) {
40
+        recordingController.onWarning = (messageKey, messageParams) => {
40 41
             dispatch(showNotification({
41 42
                 title: i18next.t('localRecording.localRecording'),
42 43
                 description: i18next.t(messageKey, messageParams)
43 44
             }, 10000));
44 45
         };
45 46
 
46
-        recordingController.onNotify = function(messageKey, messageParams) {
47
+        recordingController.onNotify = (messageKey, messageParams) => {
47 48
             dispatch(showNotification({
48 49
                 title: i18next.t('localRecording.localRecording'),
49 50
                 description: i18next.t(messageKey, messageParams)
50 51
             }, 10000));
51 52
         };
52 53
 
53
-        // register shortcut
54
-        APP.keyboardshortcut.registerShortcut(
55
-            'L',
56
-            null,
57
-            () => dispatch(toggleDialog(LocalRecordingInfoDialog)),
58
-            'keyboardShortcuts.localRecording'
59
-        );
54
+        APP.keyboardshortcut.registerShortcut('L', null, () => {
55
+            sendAnalytics(createShortcutEvent('local.recording'));
56
+            dispatch(toggleDialog(LocalRecordingInfoDialog));
57
+        }, 'keyboardShortcuts.localRecording');
60 58
         break;
61 59
     case APP_WILL_UNMOUNT:
62 60
         recordingController.onStateChanged = null;

Loading…
Peruuta
Tallenna