|
@@ -36,10 +36,12 @@ import {
|
36
|
36
|
import { showSalesforceNotification } from '../salesforce/actions';
|
37
|
37
|
import { setToolboxEnabled } from '../toolbox/actions.any';
|
38
|
38
|
|
|
39
|
+import { DISMISS_CALENDAR_NOTIFICATION } from './actionTypes';
|
39
|
40
|
// @ts-ignore
|
40
|
|
-import { notifyKickedOut } from './actions';
|
|
41
|
+import { dismissCalendarNotification, notifyKickedOut } from './actions';
|
41
|
42
|
|
42
|
|
-let intervalId: any;
|
|
43
|
+
|
|
44
|
+let intervalID: any;
|
43
|
45
|
|
44
|
46
|
|
45
|
47
|
MiddlewareRegistry.register(store => next => action => {
|
|
@@ -72,10 +74,11 @@ MiddlewareRegistry.register(store => next => action => {
|
72
|
74
|
break;
|
73
|
75
|
}
|
74
|
76
|
|
|
77
|
+ case DISMISS_CALENDAR_NOTIFICATION:
|
75
|
78
|
case CONFERENCE_LEFT:
|
76
|
79
|
case CONFERENCE_FAILED: {
|
77
|
|
- clearInterval(intervalId);
|
78
|
|
- intervalId = null;
|
|
80
|
+ clearInterval(intervalID);
|
|
81
|
+ intervalID = null;
|
79
|
82
|
|
80
|
83
|
break;
|
81
|
84
|
}
|
|
@@ -146,8 +149,8 @@ function _conferenceJoined({ dispatch, getState }: IStore) {
|
146
|
149
|
getState
|
147
|
150
|
});
|
148
|
151
|
|
149
|
|
- if (!intervalId) {
|
150
|
|
- intervalId = setInterval(() =>
|
|
152
|
+ if (!intervalID) {
|
|
153
|
+ intervalID = setInterval(() =>
|
151
|
154
|
_maybeDisplayCalendarNotification({
|
152
|
155
|
dispatch,
|
153
|
156
|
getState
|
|
@@ -232,20 +235,20 @@ function _calendarNotification({ dispatch, getState }: IStore, eventToShow: any)
|
232
|
235
|
return;
|
233
|
236
|
}
|
234
|
237
|
|
235
|
|
- const customActionNameKey = [ 'notify.joinMeeting' ];
|
236
|
|
- const customActionType = [ BUTTON_TYPES.PRIMARY ];
|
|
238
|
+ const customActionNameKey = [ 'notify.joinMeeting', 'notify.dontRemindMe' ];
|
|
239
|
+ const customActionType = [ BUTTON_TYPES.PRIMARY, BUTTON_TYPES.DESTRUCTIVE ];
|
237
|
240
|
const customActionHandler = [ () => batch(() => {
|
238
|
241
|
dispatch(hideNotification(CALENDAR_NOTIFICATION_ID));
|
239
|
242
|
if (eventToShow?.url && (eventToShow.url !== currentConferenceURL)) {
|
240
|
243
|
dispatch(appNavigate(eventToShow.url));
|
241
|
244
|
}
|
242
|
|
- }) ];
|
|
245
|
+ }), () => dispatch(dismissCalendarNotification()) ];
|
243
|
246
|
const description
|
244
|
247
|
= getLocalizedDateFormatter(eventToShow.startDate).fromNow();
|
245
|
248
|
const icon = NOTIFICATION_ICON.WARNING;
|
246
|
249
|
const title = (eventToShow.startDate < now) && (eventToShow.endDate > now)
|
247
|
|
- ? i18n.t('calendarSync.ongoingMeeting')
|
248
|
|
- : i18n.t('calendarSync.nextMeeting');
|
|
250
|
+ ? `${i18n.t('calendarSync.ongoingMeeting')}: ${eventToShow.title}`
|
|
251
|
+ : `${i18n.t('calendarSync.nextMeeting')}: ${eventToShow.title}`;
|
249
|
252
|
const uid = CALENDAR_NOTIFICATION_ID;
|
250
|
253
|
|
251
|
254
|
dispatch(showNotification({
|