|
@@ -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
|
}
|