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
This commit is contained in:
parent
c007a6194e
commit
842755674a
|
@ -132,14 +132,13 @@ export function highlightMeetingMoment() {
|
||||||
return async (dispatch: Function, getState: Function) => {
|
return async (dispatch: Function, getState: Function) => {
|
||||||
dispatch(setHighlightMomentButtonState(true));
|
dispatch(setHighlightMomentButtonState(true));
|
||||||
|
|
||||||
try {
|
const success = await sendMeetingHighlight(getState());
|
||||||
await sendMeetingHighlight(getState());
|
|
||||||
|
if (success) {
|
||||||
dispatch(showNotification({
|
dispatch(showNotification({
|
||||||
descriptionKey: 'recording.highlightMomentSucessDescription',
|
descriptionKey: 'recording.highlightMomentSucessDescription',
|
||||||
titleKey: 'recording.highlightMomentSuccess'
|
titleKey: 'recording.highlightMomentSuccess'
|
||||||
}));
|
}));
|
||||||
} catch (err) {
|
|
||||||
logger.error('Could not highlight meeting moment', err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch(setHighlightMomentButtonState(false));
|
dispatch(setHighlightMomentButtonState(false));
|
||||||
|
|
|
@ -1,10 +1,20 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
|
import { batch } from 'react-redux';
|
||||||
|
|
||||||
import { getActiveSession, isHighlightMeetingMomentDisabled } from '../..';
|
import { getActiveSession, isHighlightMeetingMomentDisabled } from '../..';
|
||||||
|
import { openDialog } from '../../../base/dialog';
|
||||||
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
|
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
|
||||||
|
import {
|
||||||
|
hideNotification,
|
||||||
|
NOTIFICATION_TIMEOUT_TYPE,
|
||||||
|
NOTIFICATION_TYPE,
|
||||||
|
showNotification
|
||||||
|
} from '../../../notifications';
|
||||||
import { highlightMeetingMoment } from '../../actions.any';
|
import { highlightMeetingMoment } from '../../actions.any';
|
||||||
|
import { StartRecordingDialog } from '../../components';
|
||||||
|
import { PROMPT_RECORDING_NOTIFICATION_ID } from '../../constants';
|
||||||
|
|
||||||
export type Props = {
|
export type Props = {
|
||||||
|
|
||||||
|
@ -45,7 +55,21 @@ export default class AbstractHighlightButton<P: Props> extends Component<P> {
|
||||||
_onClick() {
|
_onClick() {
|
||||||
const { _disabled, dispatch } = this.props;
|
const { _disabled, dispatch } = this.props;
|
||||||
|
|
||||||
if (!_disabled) {
|
if (_disabled) {
|
||||||
|
dispatch(showNotification({
|
||||||
|
descriptionKey: 'recording.highlightMomentDisabled',
|
||||||
|
titleKey: 'recording.highlightMoment',
|
||||||
|
uid: PROMPT_RECORDING_NOTIFICATION_ID,
|
||||||
|
customActionNameKey: [ 'localRecording.start' ],
|
||||||
|
customActionHandler: [ () => {
|
||||||
|
batch(() => {
|
||||||
|
dispatch(hideNotification(PROMPT_RECORDING_NOTIFICATION_ID));
|
||||||
|
dispatch(openDialog(StartRecordingDialog));
|
||||||
|
});
|
||||||
|
} ],
|
||||||
|
appearance: NOTIFICATION_TYPE.NORMAL
|
||||||
|
}, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
|
||||||
|
} else {
|
||||||
dispatch(highlightMeetingMoment());
|
dispatch(highlightMeetingMoment());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,13 @@ export const LIVE_STREAMING_OFF_SOUND_ID = 'LIVE_STREAMING_OFF_SOUND';
|
||||||
*/
|
*/
|
||||||
export const LIVE_STREAMING_ON_SOUND_ID = 'LIVE_STREAMING_ON_SOUND';
|
export const LIVE_STREAMING_ON_SOUND_ID = 'LIVE_STREAMING_ON_SOUND';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The identifier of the prompt to start recording notification.
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
export const PROMPT_RECORDING_NOTIFICATION_ID = 'PROMPT_RECORDING_NOTIFICATION_ID';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The identifier of the sound to be played when a recording session is stopped.
|
* The identifier of the sound to be played when a recording session is stopped.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue