Handles data from feedback callback and use it for correct close page.
This commit is contained in:
parent
87f7be2182
commit
5feeef0122
|
@ -184,29 +184,33 @@ function muteLocalVideo (muted) {
|
|||
* If requested show a thank you dialog before that.
|
||||
* If we have a close page enabled, redirect to it without
|
||||
* showing any other dialog.
|
||||
* @param {boolean} showThankYou whether we should show a thank you dialog
|
||||
*
|
||||
* @param {object} data Feedback data
|
||||
* @param {boolean} data.showThankYou - whether we should show thank you dialog
|
||||
* @param {boolean} data.feedbackSubmitted - whether feedback was submitted
|
||||
*/
|
||||
function maybeRedirectToWelcomePage(showThankYou) {
|
||||
|
||||
function maybeRedirectToWelcomePage(data) {
|
||||
// if close page is enabled redirect to it, without further action
|
||||
if (config.enableClosePage) {
|
||||
if (data.feedbackSubmitted)
|
||||
window.location.pathname = "close.html";
|
||||
else
|
||||
window.location.pathname = "close2.html";
|
||||
return;
|
||||
}
|
||||
|
||||
if (showThankYou) {
|
||||
// else: show thankYou dialog only if there is no feedback
|
||||
if (data.showThankYou)
|
||||
APP.UI.messageHandler.openMessageDialog(
|
||||
null, "dialog.thankYou", {appName:interfaceConfig.APP_NAME});
|
||||
}
|
||||
|
||||
if (!config.enableWelcomePage) {
|
||||
return;
|
||||
}
|
||||
// redirect to welcome page
|
||||
// if Welcome page is enabled redirect to welcome page after 3 sec.
|
||||
if (config.enableWelcomePage) {
|
||||
setTimeout(() => {
|
||||
APP.settings.setWelcomePageEnabled(true);
|
||||
window.location.pathname = "/";
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1037,25 +1037,25 @@ UI.requestFeedbackOnHangup = function () {
|
|||
if (Feedback.isVisible())
|
||||
return Promise.reject(UIErrors.FEEDBACK_REQUEST_IN_PROGRESS);
|
||||
// Feedback has been submitted already.
|
||||
else if (Feedback.isEnabled() && Feedback.isSubmitted())
|
||||
return Promise.resolve(true);
|
||||
else if (Feedback.isEnabled() && Feedback.isSubmitted()) {
|
||||
return Promise.resolve({
|
||||
showThankYou : true,
|
||||
feedbackSubmitted: true
|
||||
});
|
||||
}
|
||||
else
|
||||
return new Promise(function (resolve) {
|
||||
if (Feedback.isEnabled()) {
|
||||
// If the user has already entered feedback, we'll show the
|
||||
// window and immidiately start the conference dispose timeout.
|
||||
if (Feedback.getFeedbackScore() > 0) {
|
||||
Feedback.openFeedbackWindow();
|
||||
resolve(false);
|
||||
|
||||
} else { // Otherwise we'll wait for user's feedback.
|
||||
Feedback.openFeedbackWindow(() => resolve(false));
|
||||
}
|
||||
Feedback.openFeedbackWindow(
|
||||
(data) => {
|
||||
data.showThankYou = false;
|
||||
resolve(data);
|
||||
});
|
||||
} else {
|
||||
// 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
|
||||
resolve(true);
|
||||
resolve({showThankYou : true, feedbackSubmitted: false});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue