Bladeren bron

fix(highlight) display option to start recording (#11146)

Fix incorrect handling of error case when highlighting moments
Allow users to start recording when trying to highlight while recording not started
master
Avram Tudor 3 jaren geleden
bovenliggende
commit
8456a63a23
No account linked to committer's email address

+ 3
- 4
react/features/recording/actions.any.js Bestand weergeven

@@ -132,14 +132,13 @@ export function highlightMeetingMoment() {
132 132
     return async (dispatch: Function, getState: Function) => {
133 133
         dispatch(setHighlightMomentButtonState(true));
134 134
 
135
-        try {
136
-            await sendMeetingHighlight(getState());
135
+        const success = await sendMeetingHighlight(getState());
136
+
137
+        if (success) {
137 138
             dispatch(showNotification({
138 139
                 descriptionKey: 'recording.highlightMomentSucessDescription',
139 140
                 titleKey: 'recording.highlightMomentSuccess'
140 141
             }));
141
-        } catch (err) {
142
-            logger.error('Could not highlight meeting moment', err);
143 142
         }
144 143
 
145 144
         dispatch(setHighlightMomentButtonState(false));

+ 25
- 1
react/features/recording/components/Recording/AbstractHighlightButton.js Bestand weergeven

@@ -1,10 +1,20 @@
1 1
 // @flow
2 2
 
3 3
 import { Component } from 'react';
4
+import { batch } from 'react-redux';
4 5
 
5 6
 import { getActiveSession, isHighlightMeetingMomentDisabled } from '../..';
7
+import { openDialog } from '../../../base/dialog';
6 8
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
9
+import {
10
+    hideNotification,
11
+    NOTIFICATION_TIMEOUT_TYPE,
12
+    NOTIFICATION_TYPE,
13
+    showNotification
14
+} from '../../../notifications';
7 15
 import { highlightMeetingMoment } from '../../actions.any';
16
+import { StartRecordingDialog } from '../../components';
17
+import { PROMPT_RECORDING_NOTIFICATION_ID } from '../../constants';
8 18
 
9 19
 export type Props = {
10 20
 
@@ -45,7 +55,21 @@ export default class AbstractHighlightButton<P: Props> extends Component<P> {
45 55
     _onClick() {
46 56
         const { _disabled, dispatch } = this.props;
47 57
 
48
-        if (!_disabled) {
58
+        if (_disabled) {
59
+            dispatch(showNotification({
60
+                descriptionKey: 'recording.highlightMomentDisabled',
61
+                titleKey: 'recording.highlightMoment',
62
+                uid: PROMPT_RECORDING_NOTIFICATION_ID,
63
+                customActionNameKey: [ 'localRecording.start' ],
64
+                customActionHandler: [ () => {
65
+                    batch(() => {
66
+                        dispatch(hideNotification(PROMPT_RECORDING_NOTIFICATION_ID));
67
+                        dispatch(openDialog(StartRecordingDialog));
68
+                    });
69
+                } ],
70
+                appearance: NOTIFICATION_TYPE.NORMAL
71
+            }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
72
+        } else {
49 73
             dispatch(highlightMeetingMoment());
50 74
         }
51 75
     }

+ 7
- 0
react/features/recording/constants.js Bestand weergeven

@@ -17,6 +17,13 @@ export const LIVE_STREAMING_OFF_SOUND_ID = 'LIVE_STREAMING_OFF_SOUND';
17 17
  */
18 18
 export const LIVE_STREAMING_ON_SOUND_ID = 'LIVE_STREAMING_ON_SOUND';
19 19
 
20
+/**
21
+ * The identifier of the prompt to start recording notification.
22
+ *
23
+ * @type {string}
24
+ */
25
+export const PROMPT_RECORDING_NOTIFICATION_ID = 'PROMPT_RECORDING_NOTIFICATION_ID';
26
+
20 27
 /**
21 28
  * The identifier of the sound to be played when a recording session is stopped.
22 29
  *

Laden…
Annuleren
Opslaan