Addresses comment about Feedback dependency

This commit is contained in:
yanas 2016-08-26 16:07:20 -05:00
parent 777217bd75
commit 570124058c
4 changed files with 14 additions and 8 deletions

View File

@ -16,7 +16,7 @@ import mediaDeviceHelper from './modules/devices/mediaDeviceHelper';
import {reportError} from './modules/util/helpers'; import {reportError} from './modules/util/helpers';
import Feedback from './modules/UI/Feedback'; import UIErrors from './modules/UI/UIErrors';
const ConnectionEvents = JitsiMeetJS.events.connection; const ConnectionEvents = JitsiMeetJS.events.connection;
const ConnectionErrors = JitsiMeetJS.errors.connection; const ConnectionErrors = JitsiMeetJS.errors.connection;
@ -240,7 +240,7 @@ function hangup (requestFeedback = false) {
// to return a rejected promise. In the case of feedback request // to return a rejected promise. In the case of feedback request
// in progress it's important to not redirect to the welcome page // in progress it's important to not redirect to the welcome page
// (see below maybeRedirectToWelcomePage call). // (see below maybeRedirectToWelcomePage call).
if (err === Feedback.FEEDBACK_REQUEST_IN_PROGRESS) { if (err === UIErrors.FEEDBACK_REQUEST_IN_PROGRESS) {
return Promise.reject('Feedback request in progress.'); return Promise.reject('Feedback request in progress.');
} }
else { else {

View File

@ -86,11 +86,6 @@ function _showFeedbackButton (show) {
* toggleStars: Function, hoverStars: Function, unhoverStars: Function}} * toggleStars: Function, hoverStars: Function, unhoverStars: Function}}
*/ */
var Feedback = { var Feedback = {
/**
* Indicates a state of the Feedback dialog.
*/
FEEDBACK_REQUEST_IN_PROGRESS: "FeedbackRequestInProgress",
/** /**
* The feedback score. -1 indicates no score has been given for now. * The feedback score. -1 indicates no score has been given for now.
*/ */

View File

@ -23,6 +23,7 @@ import SettingsMenu from "./side_pannels/settings/SettingsMenu";
import Settings from "./../settings/Settings"; import Settings from "./../settings/Settings";
import { reload } from '../util/helpers'; import { reload } from '../util/helpers';
import RingOverlay from "./ring_overlay/RingOverlay"; import RingOverlay from "./ring_overlay/RingOverlay";
import UIErrors from './UIErrors';
var EventEmitter = require("events"); var EventEmitter = require("events");
UI.messageHandler = require("./util/MessageHandler"); UI.messageHandler = require("./util/MessageHandler");
@ -1064,7 +1065,7 @@ UI.inviteParticipants = function (roomUrl, conferenceName, key, nick) {
*/ */
UI.requestFeedback = function () { UI.requestFeedback = function () {
if (Feedback.isVisible()) if (Feedback.isVisible())
return Promise.reject(Feedback.FEEDBACK_REQUEST_IN_PROGRESS); return Promise.reject(UIErrors.FEEDBACK_REQUEST_IN_PROGRESS);
else else
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
if (Feedback.isEnabled()) { if (Feedback.isEnabled()) {

10
modules/UI/UIErrors.js Normal file
View File

@ -0,0 +1,10 @@
/**
* A list of all UI errors.
*/
module.exports = {
/**
* Indicates that a Feedback request is currently in progress.
* @type {{FEEDBACK_REQUEST_IN_PROGRESS: string}}
*/
FEEDBACK_REQUEST_IN_PROGRESS: "FeedbackRequestInProgress"
};