From 64126c36409d539472c047fda7199b0c1afdf574 Mon Sep 17 00:00:00 2001 From: Horatiu Muresan Date: Fri, 17 Feb 2023 13:22:20 +0200 Subject: [PATCH] chore(recording-notif) Show sticky notif for copy recording link --- react/features/recording/actions.any.ts | 31 +++++++++++++++++-------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/react/features/recording/actions.any.ts b/react/features/recording/actions.any.ts index 04950a265..b2673bb5d 100644 --- a/react/features/recording/actions.any.ts +++ b/react/features/recording/actions.any.ts @@ -213,17 +213,23 @@ export function showStartedRecordingNotification( const state = getState(); const initiatorId = getResourceId(initiator); const participantName = getParticipantDisplayName(state, initiatorId); - let dialogProps: INotificationProps = { - descriptionKey: participantName ? 'liveStreaming.onBy' : 'liveStreaming.on', - descriptionArguments: { name: participantName }, - titleKey: 'dialog.liveStreaming' + const notifyProps: { + dialogProps: INotificationProps; + type: string; + } = { + dialogProps: { + descriptionKey: participantName ? 'liveStreaming.onBy' : 'liveStreaming.on', + descriptionArguments: { name: participantName }, + titleKey: 'dialog.liveStreaming' + }, + type: NOTIFICATION_TIMEOUT_TYPE.SHORT }; if (mode !== JitsiMeetJS.constants.recording.mode.STREAM) { const recordingSharingUrl = getRecordingSharingUrl(state); const iAmRecordingInitiator = getLocalParticipant(state)?.id === initiatorId; - dialogProps = { + notifyProps.dialogProps = { customActionHandler: undefined, customActionNameKey: undefined, descriptionKey: participantName ? 'recording.onBy' : 'recording.on', @@ -248,10 +254,15 @@ export function showStartedRecordingNotification( } // add the option to copy recording link - dialogProps.customActionNameKey = [ 'recording.copyLink' ]; - dialogProps.customActionHandler = [ () => copyText(link) ]; - dialogProps.titleKey = 'recording.on'; - dialogProps.descriptionKey = 'recording.linkGenerated'; + notifyProps.dialogProps = { + ...notifyProps.dialogProps, + customActionNameKey: [ 'recording.copyLink' ], + customActionHandler: [ () => copyText(link) ], + titleKey: 'recording.on', + descriptionKey: 'recording.linkGenerated' + }; + + notifyProps.type = NOTIFICATION_TIMEOUT_TYPE.STICKY; } catch (err) { dispatch(showErrorNotification({ titleKey: 'recording.errorFetchingLink' @@ -262,7 +273,7 @@ export function showStartedRecordingNotification( } } - dispatch(showNotification(dialogProps, NOTIFICATION_TIMEOUT_TYPE.SHORT)); + dispatch(showNotification(notifyProps.dialogProps, notifyProps.type)); }; }