瀏覽代碼

fix(visitors) remove default notification (#14970)

factor2
Mihaela Dumitru 1 年之前
父節點
當前提交
1c12f5cf2a
No account linked to committer's email address
共有 2 個文件被更改,包括 13 次插入14 次删除
  1. 0
    1
      lang/main.json
  2. 13
    13
      react/features/visitors/middleware.ts

+ 0
- 1
lang/main.json 查看文件

@@ -1503,7 +1503,6 @@
1503 1503
         "labelTooltip": "Number of visitors: {{count}}",
1504 1504
         "notification": {
1505 1505
             "demoteDescription": "Sent here by {{actor}}, raise your hand to participate",
1506
-            "description": "To participate raise your hand",
1507 1506
             "noMainParticipantsDescription": "A participant needs to start the meeting. Please try again in a bit.",
1508 1507
             "noMainParticipantsTitle": "This meeting hasn’t started yet.",
1509 1508
             "noVisitorLobby": "You cannot join while there is a lobby enabled for the meeting.",

+ 13
- 13
react/features/visitors/middleware.ts 查看文件

@@ -72,26 +72,26 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
72 72
         const { conference } = action;
73 73
 
74 74
         if (getState()['features/visitors'].iAmVisitor) {
75
-            dispatch(openDialog(JoinMeetingDialog));
76 75
 
77 76
             const { demoteActorDisplayName } = getState()['features/visitors'];
78 77
 
79
-            dispatch(setVisitorDemoteActor(undefined));
80
-
81
-            const notificationParams: INotificationProps = {
82
-                titleKey: 'visitors.notification.title',
83
-                descriptionKey: 'visitors.notification.description'
84
-            };
85
-
86 78
             if (demoteActorDisplayName) {
87
-                notificationParams.descriptionKey = 'visitors.notification.demoteDescription';
88
-                notificationParams.descriptionArguments = {
89
-                    actor: demoteActorDisplayName
79
+                const notificationParams: INotificationProps = {
80
+                    titleKey: 'visitors.notification.title',
81
+                    descriptionKey: 'visitors.notification.demoteDescription',
82
+                    descriptionArguments: {
83
+                        actor: demoteActorDisplayName
84
+                    }
90 85
                 };
86
+
87
+                batch(() => {
88
+                    dispatch(showNotification(notificationParams, NOTIFICATION_TIMEOUT_TYPE.STICKY));
89
+                    dispatch(setVisitorDemoteActor(undefined));
90
+                });
91
+            } else {
92
+                dispatch(openDialog(JoinMeetingDialog));
91 93
             }
92 94
 
93
-            // check for demote actor and update notification
94
-            dispatch(showNotification(notificationParams, NOTIFICATION_TIMEOUT_TYPE.STICKY));
95 95
         } else {
96 96
             dispatch(setVisitorsSupported(conference.isVisitorsSupported()));
97 97
             conference.on(JitsiConferenceEvents.VISITORS_SUPPORTED_CHANGED, (value: boolean) => {

Loading…
取消
儲存