Bug 1119485 - Link clicker UI no longer resets to the stat conversation view after giving feedback. r=nperriault
authorMark Banner <standard8@mozilla.com>
Fri, 09 Jan 2015 09:07:46 +0000
changeset 248742 4d9cadf294342e7053d61e95b35013d732c7b4ca
parent 248741 76b4e802be978a693f6781a0ad8e2e678b65d859
child 248743 7c03738e7a95a7d77f9cad311c02ea8d6d87e605
child 248782 569130fd40b5ee417e56b5ebd64d40b5a7c24441
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnperriault
bugs1119485
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1119485 - Link clicker UI no longer resets to the stat conversation view after giving feedback. r=nperriault
browser/components/loop/content/shared/js/feedbackViews.js
browser/components/loop/content/shared/js/feedbackViews.jsx
--- a/browser/components/loop/content/shared/js/feedbackViews.js
+++ b/browser/components/loop/content/shared/js/feedbackViews.js
@@ -177,33 +177,34 @@ loop.shared.views.FeedbackView = (functi
     },
 
     getInitialState: function() {
       return {countdown: WINDOW_AUTOCLOSE_TIMEOUT_IN_SECONDS};
     },
 
     componentDidMount: function() {
       this._timer = setInterval(function() {
+      if (this.state.countdown == 1) {
+        clearInterval(this._timer);
+        if (this.props.onAfterFeedbackReceived) {
+          this.props.onAfterFeedbackReceived();
+        }
+        return;
+      }
         this.setState({countdown: this.state.countdown - 1});
       }.bind(this), 1000);
     },
 
     componentWillUnmount: function() {
       if (this._timer) {
         clearInterval(this._timer);
       }
     },
 
     render: function() {
-      if (this.state.countdown < 1) {
-        clearInterval(this._timer);
-        if (this.props.onAfterFeedbackReceived) {
-          this.props.onAfterFeedbackReceived();
-        }
-      }
       return (
         React.createElement(FeedbackLayout, {title: l10n.get("feedback_thank_you_heading")}, 
           React.createElement("p", {className: "info thank-you"}, 
             l10n.get("feedback_window_will_close_in2", {
               countdown: this.state.countdown,
               num: this.state.countdown
             }))
         )
--- a/browser/components/loop/content/shared/js/feedbackViews.jsx
+++ b/browser/components/loop/content/shared/js/feedbackViews.jsx
@@ -177,33 +177,34 @@ loop.shared.views.FeedbackView = (functi
     },
 
     getInitialState: function() {
       return {countdown: WINDOW_AUTOCLOSE_TIMEOUT_IN_SECONDS};
     },
 
     componentDidMount: function() {
       this._timer = setInterval(function() {
+      if (this.state.countdown == 1) {
+        clearInterval(this._timer);
+        if (this.props.onAfterFeedbackReceived) {
+          this.props.onAfterFeedbackReceived();
+        }
+        return;
+      }
         this.setState({countdown: this.state.countdown - 1});
       }.bind(this), 1000);
     },
 
     componentWillUnmount: function() {
       if (this._timer) {
         clearInterval(this._timer);
       }
     },
 
     render: function() {
-      if (this.state.countdown < 1) {
-        clearInterval(this._timer);
-        if (this.props.onAfterFeedbackReceived) {
-          this.props.onAfterFeedbackReceived();
-        }
-      }
       return (
         <FeedbackLayout title={l10n.get("feedback_thank_you_heading")}>
           <p className="info thank-you">{
             l10n.get("feedback_window_will_close_in2", {
               countdown: this.state.countdown,
               num: this.state.countdown
             })}</p>
         </FeedbackLayout>