chore(recording-notif) Show sticky notif for copy recording link

This commit is contained in:
Horatiu Muresan 2023-02-17 13:22:20 +02:00
parent ef0168c9ff
commit 64126c3640
1 changed files with 21 additions and 10 deletions

View File

@ -213,17 +213,23 @@ export function showStartedRecordingNotification(
const state = getState(); const state = getState();
const initiatorId = getResourceId(initiator); const initiatorId = getResourceId(initiator);
const participantName = getParticipantDisplayName(state, initiatorId); const participantName = getParticipantDisplayName(state, initiatorId);
let dialogProps: INotificationProps = { const notifyProps: {
dialogProps: INotificationProps;
type: string;
} = {
dialogProps: {
descriptionKey: participantName ? 'liveStreaming.onBy' : 'liveStreaming.on', descriptionKey: participantName ? 'liveStreaming.onBy' : 'liveStreaming.on',
descriptionArguments: { name: participantName }, descriptionArguments: { name: participantName },
titleKey: 'dialog.liveStreaming' titleKey: 'dialog.liveStreaming'
},
type: NOTIFICATION_TIMEOUT_TYPE.SHORT
}; };
if (mode !== JitsiMeetJS.constants.recording.mode.STREAM) { if (mode !== JitsiMeetJS.constants.recording.mode.STREAM) {
const recordingSharingUrl = getRecordingSharingUrl(state); const recordingSharingUrl = getRecordingSharingUrl(state);
const iAmRecordingInitiator = getLocalParticipant(state)?.id === initiatorId; const iAmRecordingInitiator = getLocalParticipant(state)?.id === initiatorId;
dialogProps = { notifyProps.dialogProps = {
customActionHandler: undefined, customActionHandler: undefined,
customActionNameKey: undefined, customActionNameKey: undefined,
descriptionKey: participantName ? 'recording.onBy' : 'recording.on', descriptionKey: participantName ? 'recording.onBy' : 'recording.on',
@ -248,10 +254,15 @@ export function showStartedRecordingNotification(
} }
// add the option to copy recording link // add the option to copy recording link
dialogProps.customActionNameKey = [ 'recording.copyLink' ]; notifyProps.dialogProps = {
dialogProps.customActionHandler = [ () => copyText(link) ]; ...notifyProps.dialogProps,
dialogProps.titleKey = 'recording.on'; customActionNameKey: [ 'recording.copyLink' ],
dialogProps.descriptionKey = 'recording.linkGenerated'; customActionHandler: [ () => copyText(link) ],
titleKey: 'recording.on',
descriptionKey: 'recording.linkGenerated'
};
notifyProps.type = NOTIFICATION_TIMEOUT_TYPE.STICKY;
} catch (err) { } catch (err) {
dispatch(showErrorNotification({ dispatch(showErrorNotification({
titleKey: 'recording.errorFetchingLink' titleKey: 'recording.errorFetchingLink'
@ -262,7 +273,7 @@ export function showStartedRecordingNotification(
} }
} }
dispatch(showNotification(dialogProps, NOTIFICATION_TIMEOUT_TYPE.SHORT)); dispatch(showNotification(notifyProps.dialogProps, notifyProps.type));
}; };
} }