Fixes hangup triggering several times
This commit is contained in:
parent
b5c1c95a15
commit
2bb637e140
|
@ -37,6 +37,12 @@ let connectionIsInterrupted = false;
|
||||||
*/
|
*/
|
||||||
let DSExternalInstallationInProgress = false;
|
let DSExternalInstallationInProgress = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether we have started a hangup process.
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
let _hangupInProgress = false;
|
||||||
|
|
||||||
import {VIDEO_CONTAINER_TYPE} from "./modules/UI/videolayout/LargeVideo";
|
import {VIDEO_CONTAINER_TYPE} from "./modules/UI/videolayout/LargeVideo";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -232,6 +238,13 @@ function disconnectAndShowFeedback(requestFeedback) {
|
||||||
* @param {boolean} [requestFeedback=false] if user feedback should be requested
|
* @param {boolean} [requestFeedback=false] if user feedback should be requested
|
||||||
*/
|
*/
|
||||||
function hangup (requestFeedback = false) {
|
function hangup (requestFeedback = false) {
|
||||||
|
if (_hangupInProgress) {
|
||||||
|
console.log("Hangup already in progress.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_hangupInProgress = true;
|
||||||
|
|
||||||
const errCallback = (f, err) => {
|
const errCallback = (f, err) => {
|
||||||
console.error('Error occurred during hanging up: ', err);
|
console.error('Error occurred during hanging up: ', err);
|
||||||
return f();
|
return f();
|
||||||
|
@ -242,6 +255,8 @@ function hangup (requestFeedback = false) {
|
||||||
.catch(errCallback.bind(null, disconnect))
|
.catch(errCallback.bind(null, disconnect))
|
||||||
.then(maybeRedirectToWelcomePage)
|
.then(maybeRedirectToWelcomePage)
|
||||||
.catch(errCallback.bind(null, maybeRedirectToWelcomePage));
|
.catch(errCallback.bind(null, maybeRedirectToWelcomePage));
|
||||||
|
|
||||||
|
_hangupInProgress = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -134,6 +134,17 @@ var Feedback = {
|
||||||
isEnabled: function() {
|
isEnabled: function() {
|
||||||
return this.enabled && APP.conference.isCallstatsEnabled();
|
return this.enabled && APP.conference.isCallstatsEnabled();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the feedback window is currently visible and false
|
||||||
|
* otherwise.
|
||||||
|
* @return {boolean} true if the feedback window is visible, false
|
||||||
|
* otherwise
|
||||||
|
*/
|
||||||
|
isVisible: function() {
|
||||||
|
return $(".feedback").is(":visible");
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the feedback window.
|
* Opens the feedback window.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1063,29 +1063,32 @@ UI.inviteParticipants = function (roomUrl, conferenceName, key, nick) {
|
||||||
* @returns {Promise} when dialog is closed.
|
* @returns {Promise} when dialog is closed.
|
||||||
*/
|
*/
|
||||||
UI.requestFeedback = function () {
|
UI.requestFeedback = function () {
|
||||||
return new Promise(function (resolve, reject) {
|
if (Feedback.isVisible())
|
||||||
if (Feedback.isEnabled()) {
|
return Promise.resolve();
|
||||||
// If the user has already entered feedback, we'll show the window and
|
else
|
||||||
// immidiately start the conference dispose timeout.
|
return new Promise(function (resolve, reject) {
|
||||||
if (Feedback.feedbackScore > 0) {
|
if (Feedback.isEnabled()) {
|
||||||
Feedback.openFeedbackWindow();
|
// If the user has already entered feedback, we'll show the
|
||||||
resolve();
|
// window and immidiately start the conference dispose timeout.
|
||||||
|
if (Feedback.feedbackScore > 0) {
|
||||||
|
Feedback.openFeedbackWindow();
|
||||||
|
resolve();
|
||||||
|
|
||||||
} else { // Otherwise we'll wait for user's feedback.
|
} else { // Otherwise we'll wait for user's feedback.
|
||||||
Feedback.openFeedbackWindow(resolve);
|
Feedback.openFeedbackWindow(resolve);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// If the feedback functionality isn't enabled we show a thank
|
||||||
|
// you dialog.
|
||||||
|
messageHandler.openMessageDialog(
|
||||||
|
null, null, null,
|
||||||
|
APP.translation.translateString(
|
||||||
|
"dialog.thankYou", {appName:interfaceConfig.APP_NAME}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
resolve();
|
||||||
}
|
}
|
||||||
} else {
|
});
|
||||||
// If the feedback functionality isn't enabled we show a thank you
|
|
||||||
// dialog.
|
|
||||||
messageHandler.openMessageDialog(
|
|
||||||
null, null, null,
|
|
||||||
APP.translation.translateString(
|
|
||||||
"dialog.thankYou", {appName:interfaceConfig.APP_NAME}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
UI.updateRecordingState = function (state) {
|
UI.updateRecordingState = function (state) {
|
||||||
|
|
Loading…
Reference in New Issue