Prefers public getters over duplication of logic and/or access to private fields at multiple locations.
This commit is contained in:
parent
d7c9a97e8d
commit
2b570a2251
|
@ -79,7 +79,7 @@ var Feedback = {
|
|||
init: function () {
|
||||
// CallStats is the way we send feedback, so we don't have to initialise
|
||||
// if callstats isn't enabled.
|
||||
if (!callStats.isEnabled())
|
||||
if (!this.isEnabled())
|
||||
return;
|
||||
|
||||
$("div.feedbackButton").css("display", "block");
|
||||
|
@ -93,6 +93,9 @@ var Feedback = {
|
|||
* @return true if the feedback functionality is enabled, false otherwise.
|
||||
*/
|
||||
isEnabled: function() {
|
||||
// XXX callStats.isEnabled() indicates whether we are allowed to attempt
|
||||
// to integrate callstats.io. Whether our attempt was/is/will be
|
||||
// successful is a different question.
|
||||
return callStats.isEnabled();
|
||||
},
|
||||
/**
|
||||
|
@ -234,4 +237,4 @@ var Feedback = {
|
|||
};
|
||||
|
||||
// Exports the Feedback class.
|
||||
module.exports = Feedback;
|
||||
module.exports = Feedback;
|
||||
|
|
|
@ -31,7 +31,7 @@ var callStatsIntegrationEnabled = config.callStatsID && config.callStatsSecret;
|
|||
|
||||
var CallStats = {
|
||||
init: function (jingleSession) {
|
||||
if(!callStatsIntegrationEnabled || callStats !== null) {
|
||||
if(!this.isEnabled() || callStats !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ var CallStats = {
|
|||
_reportError: function (type, e, pc) {
|
||||
if (callStats) {
|
||||
callStats.reportError(pc, this.confID, type, e);
|
||||
} else if (callStatsIntegrationEnabled) {
|
||||
} else if (this.isEnabled()) {
|
||||
pendingErrors.push({
|
||||
type: type,
|
||||
error: e,
|
||||
|
|
Loading…
Reference in New Issue