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

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

14
     NOTIFICATION_TIMEOUT_TYPE,
14
     NOTIFICATION_TIMEOUT_TYPE,
15
     RAISE_HAND_NOTIFICATION_ID
15
     RAISE_HAND_NOTIFICATION_ID
16
 } from '../../notifications/constants';
16
 } from '../../notifications/constants';
17
+import { open as openParticipantsPane } from '../../participants-pane/actions';
17
 import { isForceMuted } from '../../participants-pane/functions';
18
 import { isForceMuted } from '../../participants-pane/functions';
18
 import { CALLING, INVITED } from '../../presence-status/constants';
19
 import { CALLING, INVITED } from '../../presence-status/constants';
19
 import { RAISE_HAND_SOUND_ID } from '../../reactions/constants';
20
 import { RAISE_HAND_SOUND_ID } from '../../reactions/constants';
783
             || isForceMuted(participant, MEDIA_TYPE.VIDEO, state);
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
     if (raisedHandTimestamp) {
801
     if (raisedHandTimestamp) {
792
         let notificationTitle;
802
         let notificationTitle;
810
             concatText: true,
820
             concatText: true,
811
             uid: RAISE_HAND_NOTIFICATION_ID,
821
             uid: RAISE_HAND_NOTIFICATION_ID,
812
             ...action
822
             ...action
813
-        }, shouldDisplayAllowAction ? NOTIFICATION_TIMEOUT_TYPE.MEDIUM : NOTIFICATION_TIMEOUT_TYPE.SHORT));
823
+        }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
814
         dispatch(playSound(RAISE_HAND_SOUND_ID));
824
         dispatch(playSound(RAISE_HAND_SOUND_ID));
815
     }
825
     }
816
 }
826
 }

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

3
 import { batch } from 'react-redux';
3
 import { batch } from 'react-redux';
4
 
4
 
5
 import { IStore } from '../../app/types';
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
 import { getCurrentConference } from '../conference/functions';
8
 import { getCurrentConference } from '../conference/functions';
9
 import { getSsrcRewritingFeatureFlag, hasBeenNotified, isNextToSpeak } from '../config/functions.any';
9
 import { getSsrcRewritingFeatureFlag, hasBeenNotified, isNextToSpeak } from '../config/functions.any';
10
 import { VIDEO_TYPE } from '../media/constants';
10
 import { VIDEO_TYPE } from '../media/constants';
36
         if (raisedHandsQueue.length && isNextToSpeak(store.getState()) && !hasBeenNotified(store.getState())) {
36
         if (raisedHandsQueue.length && isNextToSpeak(store.getState()) && !hasBeenNotified(store.getState())) {
37
             _notifyNextSpeakerInRaisedHandQueue(store);
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