Bläddra i källkod

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 år sedan
förälder
incheckning
8456a63a23
Inget konto är kopplat till bidragsgivarens mejladress

+ 3
- 4
react/features/recording/actions.any.js Visa fil

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

+ 25
- 1
react/features/recording/components/Recording/AbstractHighlightButton.js Visa fil

1
 // @flow
1
 // @flow
2
 
2
 
3
 import { Component } from 'react';
3
 import { Component } from 'react';
4
+import { batch } from 'react-redux';
4
 
5
 
5
 import { getActiveSession, isHighlightMeetingMomentDisabled } from '../..';
6
 import { getActiveSession, isHighlightMeetingMomentDisabled } from '../..';
7
+import { openDialog } from '../../../base/dialog';
6
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
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
 import { highlightMeetingMoment } from '../../actions.any';
15
 import { highlightMeetingMoment } from '../../actions.any';
16
+import { StartRecordingDialog } from '../../components';
17
+import { PROMPT_RECORDING_NOTIFICATION_ID } from '../../constants';
8
 
18
 
9
 export type Props = {
19
 export type Props = {
10
 
20
 
45
     _onClick() {
55
     _onClick() {
46
         const { _disabled, dispatch } = this.props;
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
             dispatch(highlightMeetingMoment());
73
             dispatch(highlightMeetingMoment());
50
         }
74
         }
51
     }
75
     }

+ 7
- 0
react/features/recording/constants.js Visa fil

17
  */
17
  */
18
 export const LIVE_STREAMING_ON_SOUND_ID = 'LIVE_STREAMING_ON_SOUND';
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
  * The identifier of the sound to be played when a recording session is stopped.
28
  * The identifier of the sound to be played when a recording session is stopped.
22
  *
29
  *

Laddar…
Avbryt
Spara