From 584d49dcf3fc94f8a206d3bd059c0c5c5ffee294 Mon Sep 17 00:00:00 2001 From: Calin-Teodor Date: Wed, 22 Feb 2023 17:56:20 +0200 Subject: [PATCH] feat(calendar-sync): added onDismissed method --- .../ConferenceNotification.native.js | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/react/features/calendar-sync/components/ConferenceNotification.native.js b/react/features/calendar-sync/components/ConferenceNotification.native.js index 699e0a698..3415bd5da 100644 --- a/react/features/calendar-sync/components/ConferenceNotification.native.js +++ b/react/features/calendar-sync/components/ConferenceNotification.native.js @@ -9,7 +9,8 @@ import { connect } from '../../base/redux'; import { BUTTON_TYPES } from '../../base/ui/constants.native'; import { CALENDAR_NOTIFICATION_ID, - NOTIFICATION_ICON + NOTIFICATION_ICON, + hideNotification } from '../../notifications'; import Notification from '../../notifications/components/native/Notification'; @@ -78,6 +79,7 @@ class ConferenceNotification extends Component { this._maybeDisplayNotification = this._maybeDisplayNotification.bind(this); this._onGoToNext = this._onGoToNext.bind(this); + this._onDismissed = this._onDismissed.bind(this); } /** @@ -127,6 +129,7 @@ class ConferenceNotification extends Component { customActionType = { customActionType } description = { description } icon = { NOTIFICATION_ICON.WARNING } + onDismissed = { this._onDismissed } title = { t(title) } uid = { CALENDAR_NOTIFICATION_ID } /> ); @@ -172,6 +175,21 @@ class ConferenceNotification extends Component { }); } + _onDismissed: number => void; + + /** + * Emits an action to remove the notification from the redux store so it + * stops displaying. + * + * @param {number} uid - The id of the notification to be removed. + * @private + * @returns {void} + */ + _onDismissed() { + clearInterval(this.updateIntervalId); + this.props.dispatch(hideNotification(CALENDAR_NOTIFICATION_ID)); + } + _onGoToNext: () => void; /**