Bug 1036661 Accessing the loop panel for the first time triggers an error message in the console. r=dolske

This commit is contained in:
Mark Banner 2014-07-17 09:27:48 +01:00
parent 4587cd809a
commit ef95024fc3
4 changed files with 4 additions and 3 deletions

View File

@ -1519,6 +1519,7 @@ pref("loop.enabled", false);
#endif
pref("loop.server", "https://loop.services.mozilla.com");
pref("loop.seenToS", "unseen");
pref("loop.do_not_disturb", false);
pref("loop.ringtone", "chrome://browser/content/loop/shared/sounds/Firefox-Long.ogg");

View File

@ -113,7 +113,7 @@ loop.panel = (function(_, mozL10n) {
"privacy_notice_url": "www.mozilla.org/privacy/"
});
if (!this.state.seenToS) {
if (this.state.seenToS == "unseen") {
navigator.mozLoop.setLoopCharPref('seenToS', 'seen');
return React.DOM.p( {className:"terms-service",
dangerouslySetInnerHTML:{__html: tosHTML}});

View File

@ -113,7 +113,7 @@ loop.panel = (function(_, mozL10n) {
"privacy_notice_url": "www.mozilla.org/privacy/"
});
if (!this.state.seenToS) {
if (this.state.seenToS == "unseen") {
navigator.mozLoop.setLoopCharPref('seenToS', 'seen');
return <p className="terms-service"
dangerouslySetInnerHTML={{__html: tosHTML}}></p>;

View File

@ -48,7 +48,7 @@ describe("loop.panel", function() {
return "en-US";
},
setLoopCharPref: sandbox.stub(),
getLoopCharPref: sandbox.stub()
getLoopCharPref: sandbox.stub().returns("unseen")
};
document.mozL10n.initialize(navigator.mozLoop);