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

This commit is contained in:
Leonard Kim 2017-12-11 10:44:38 -08:00 committed by yanas
parent 7341c7bf84
commit f3b5ed2ef4
2 changed files with 13 additions and 10 deletions

View File

@ -62,6 +62,7 @@ import {
setVideoAvailable,
setVideoMuted
} from './react/features/base/media';
import { showNotification } from './react/features/notifications';
import {
dominantSpeakerChanged,
getAvatarURLByParticipantId,
@ -203,7 +204,7 @@ function muteLocalVideo(muted) {
*
* @param {object} options used to decide which particular close page to show
* or if close page is disabled, whether we should show the thankyou dialog
* @param {boolean} options.thankYouDialogVisible - whether we should
* @param {boolean} options.showThankYou - whether we should
* show thank you dialog
* @param {boolean} options.feedbackSubmitted - whether feedback was submitted
*/
@ -222,9 +223,11 @@ function maybeRedirectToWelcomePage(options) {
}
// else: show thankYou dialog only if there is no feedback
if (options.thankYouDialogVisible) {
APP.UI.messageHandler.openMessageDialog(
null, 'dialog.thankYou', { appName: interfaceConfig.APP_NAME });
if (options.showThankYou) {
APP.store.dispatch(showNotification({
titleArguments: { appName: interfaceConfig.APP_NAME },
titleKey: 'dialog.thankYou'
}));
}
// if Welcome page is enabled redirect to welcome page after 3 sec.

View File

@ -43,7 +43,7 @@ export function cancelFeedback(score: number, message: string) {
export function maybeOpenFeedbackDialog(conference: Object) {
type R = {
feedbackSubmitted: boolean,
thankYouDialogVisible: boolean
showThankYou: boolean
};
return (dispatch: Dispatch<*>, getState: Function): Promise<R> => {
@ -61,7 +61,7 @@ export function maybeOpenFeedbackDialog(conference: Object) {
return Promise.resolve({
feedbackSubmitted: true,
thankYouDialogVisible: true
showThankYou: true
});
} else if (conference.isCallstatsEnabled()) {
return new Promise(resolve => {
@ -70,18 +70,18 @@ export function maybeOpenFeedbackDialog(conference: Object) {
resolve({
feedbackSubmitted: submitted,
thankYouDialogVisible: false
showThankYou: false
});
}));
});
}
// If the feedback functionality isn't enabled we show a "thank you"
// dialog. Signaling it (true), so the caller of requestFeedback can act
// on it.
// message. Signaling it (true), so the caller of requestFeedback can
// act on it.
return Promise.resolve({
feedbackSubmitted: false,
thankYouDialogVisible: true
showThankYou: true
});
};
}