Pārlūkot izejas kodu

ref(notifications): convert Thank You message to a notification

master
Leonard Kim 7 gadus atpakaļ
vecāks
revīzija
f3b5ed2ef4
2 mainītis faili ar 13 papildinājumiem un 10 dzēšanām
  1. 7
    4
      conference.js
  2. 6
    6
      react/features/feedback/actions.js

+ 7
- 4
conference.js Parādīt failu

62
     setVideoAvailable,
62
     setVideoAvailable,
63
     setVideoMuted
63
     setVideoMuted
64
 } from './react/features/base/media';
64
 } from './react/features/base/media';
65
+import { showNotification } from './react/features/notifications';
65
 import {
66
 import {
66
     dominantSpeakerChanged,
67
     dominantSpeakerChanged,
67
     getAvatarURLByParticipantId,
68
     getAvatarURLByParticipantId,
203
  *
204
  *
204
  * @param {object} options used to decide which particular close page to show
205
  * @param {object} options used to decide which particular close page to show
205
  * or if close page is disabled, whether we should show the thankyou dialog
206
  * or if close page is disabled, whether we should show the thankyou dialog
206
- * @param {boolean} options.thankYouDialogVisible - whether we should
207
+ * @param {boolean} options.showThankYou - whether we should
207
  * show thank you dialog
208
  * show thank you dialog
208
  * @param {boolean} options.feedbackSubmitted - whether feedback was submitted
209
  * @param {boolean} options.feedbackSubmitted - whether feedback was submitted
209
  */
210
  */
222
     }
223
     }
223
 
224
 
224
     // else: show thankYou dialog only if there is no feedback
225
     // else: show thankYou dialog only if there is no feedback
225
-    if (options.thankYouDialogVisible) {
226
-        APP.UI.messageHandler.openMessageDialog(
227
-            null, 'dialog.thankYou', { appName: interfaceConfig.APP_NAME });
226
+    if (options.showThankYou) {
227
+        APP.store.dispatch(showNotification({
228
+            titleArguments: { appName: interfaceConfig.APP_NAME },
229
+            titleKey: 'dialog.thankYou'
230
+        }));
228
     }
231
     }
229
 
232
 
230
     // if Welcome page is enabled redirect to welcome page after 3 sec.
233
     // if Welcome page is enabled redirect to welcome page after 3 sec.

+ 6
- 6
react/features/feedback/actions.js Parādīt failu

43
 export function maybeOpenFeedbackDialog(conference: Object) {
43
 export function maybeOpenFeedbackDialog(conference: Object) {
44
     type R = {
44
     type R = {
45
         feedbackSubmitted: boolean,
45
         feedbackSubmitted: boolean,
46
-        thankYouDialogVisible: boolean
46
+        showThankYou: boolean
47
     };
47
     };
48
 
48
 
49
     return (dispatch: Dispatch<*>, getState: Function): Promise<R> => {
49
     return (dispatch: Dispatch<*>, getState: Function): Promise<R> => {
61
 
61
 
62
             return Promise.resolve({
62
             return Promise.resolve({
63
                 feedbackSubmitted: true,
63
                 feedbackSubmitted: true,
64
-                thankYouDialogVisible: true
64
+                showThankYou: true
65
             });
65
             });
66
         } else if (conference.isCallstatsEnabled()) {
66
         } else if (conference.isCallstatsEnabled()) {
67
             return new Promise(resolve => {
67
             return new Promise(resolve => {
70
 
70
 
71
                     resolve({
71
                     resolve({
72
                         feedbackSubmitted: submitted,
72
                         feedbackSubmitted: submitted,
73
-                        thankYouDialogVisible: false
73
+                        showThankYou: false
74
                     });
74
                     });
75
                 }));
75
                 }));
76
             });
76
             });
77
         }
77
         }
78
 
78
 
79
         // If the feedback functionality isn't enabled we show a "thank you"
79
         // If the feedback functionality isn't enabled we show a "thank you"
80
-        // dialog. Signaling it (true), so the caller of requestFeedback can act
81
-        // on it.
80
+        // message. Signaling it (true), so the caller of requestFeedback can
81
+        // act on it.
82
         return Promise.resolve({
82
         return Promise.resolve({
83
             feedbackSubmitted: false,
83
             feedbackSubmitted: false,
84
-            thankYouDialogVisible: true
84
+            showThankYou: true
85
         });
85
         });
86
     };
86
     };
87
 }
87
 }

Notiek ielāde…
Atcelt
Saglabāt