Browse Source

feat(raise-han) add CTA for opening participants pane on notification

factor2
Mengyuan Liu 1 year ago
parent
commit
673a54adb1
No account linked to committer's email address

+ 1
- 0
lang/main.json View File

@@ -821,6 +821,7 @@
821 821
         "videoUnmuteBlockedDescription": "Camera unmute and desktop sharing operation have been temporarily blocked because of system limits.",
822 822
         "videoUnmuteBlockedTitle": "Camera unmute and desktop sharing blocked!",
823 823
         "viewLobby": "View lobby",
824
+        "viewParticipants": "View participants",
824 825
         "viewVisitors": "View visitors",
825 826
         "waitingParticipants": "{{waitingParticipants}} people",
826 827
         "waitingVisitors": "Visitors waiting in queue: {{waitingVisitors}}",

+ 15
- 5
react/features/base/participants/middleware.ts View File

@@ -14,6 +14,7 @@ import {
14 14
     NOTIFICATION_TIMEOUT_TYPE,
15 15
     RAISE_HAND_NOTIFICATION_ID
16 16
 } from '../../notifications/constants';
17
+import { open as openParticipantsPane } from '../../participants-pane/actions';
17 18
 import { isForceMuted } from '../../participants-pane/functions';
18 19
 import { CALLING, INVITED } from '../../presence-status/constants';
19 20
 import { RAISE_HAND_SOUND_ID } from '../../reactions/constants';
@@ -783,10 +784,19 @@ function _raiseHandUpdated({ dispatch, getState }: IStore, conference: IJitsiCon
783 784
             || isForceMuted(participant, MEDIA_TYPE.VIDEO, state);
784 785
     }
785 786
 
786
-    const action = shouldDisplayAllowAction ? {
787
-        customActionNameKey: [ 'notify.allowAction' ],
788
-        customActionHandler: [ () => dispatch(approveParticipant(participantId)) ]
789
-    } : {};
787
+    let action;
788
+
789
+    if (shouldDisplayAllowAction) {
790
+        action = {
791
+            customActionNameKey: [ 'notify.allowAction' ],
792
+            customActionHandler: [ () => dispatch(approveParticipant(participantId)) ]
793
+        };
794
+    } else {
795
+        action = {
796
+            customActionNameKey: [ 'notify.viewParticipants' ],
797
+            customActionHandler: [ () => dispatch(openParticipantsPane()) ]
798
+        };
799
+    }
790 800
 
791 801
     if (raisedHandTimestamp) {
792 802
         let notificationTitle;
@@ -810,7 +820,7 @@ function _raiseHandUpdated({ dispatch, getState }: IStore, conference: IJitsiCon
810 820
             concatText: true,
811 821
             uid: RAISE_HAND_NOTIFICATION_ID,
812 822
             ...action
813
-        }, shouldDisplayAllowAction ? NOTIFICATION_TIMEOUT_TYPE.MEDIUM : NOTIFICATION_TIMEOUT_TYPE.SHORT));
823
+        }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
814 824
         dispatch(playSound(RAISE_HAND_SOUND_ID));
815 825
     }
816 826
 }

+ 5
- 2
react/features/base/participants/subscriber.ts View File

@@ -3,8 +3,8 @@ import _ from 'lodash';
3 3
 import { batch } from 'react-redux';
4 4
 
5 5
 import { IStore } from '../../app/types';
6
-import { showNotification } from '../../notifications/actions';
7
-import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
6
+import { hideNotification, showNotification } from '../../notifications/actions';
7
+import { NOTIFICATION_TIMEOUT_TYPE, RAISE_HAND_NOTIFICATION_ID } from '../../notifications/constants';
8 8
 import { getCurrentConference } from '../conference/functions';
9 9
 import { getSsrcRewritingFeatureFlag, hasBeenNotified, isNextToSpeak } from '../config/functions.any';
10 10
 import { VIDEO_TYPE } from '../media/constants';
@@ -36,6 +36,9 @@ StateListenerRegistry.register(
36 36
         if (raisedHandsQueue.length && isNextToSpeak(store.getState()) && !hasBeenNotified(store.getState())) {
37 37
             _notifyNextSpeakerInRaisedHandQueue(store);
38 38
         }
39
+        if (!raisedHandsQueue[0]) {
40
+            store.dispatch(hideNotification(RAISE_HAND_NOTIFICATION_ID));
41
+        }
39 42
     }
40 43
 );
41 44
 

Loading…
Cancel
Save