From d871ca2b243e910e1aced3e90c6a0518ab76b76c Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 8 Nov 2016 11:43:24 +0000 Subject: [PATCH] PR feedback --- src/BasePlatform.js | 2 +- src/components/structures/UserSettings.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/BasePlatform.js b/src/BasePlatform.js index ffb32fce64..897a1a2dc8 100644 --- a/src/BasePlatform.js +++ b/src/BasePlatform.js @@ -71,6 +71,6 @@ export default class BasePlatform { * the current version of the application. */ getAppVersion() { - return q(); + throw new Error("getAppVersion not implemented!"); } } diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index b69793c539..c139999748 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -36,7 +36,6 @@ module.exports = React.createClass({ displayName: 'UserSettings', propTypes: { - version: React.PropTypes.string, onClose: React.PropTypes.func, // The brand string given when creating email pushers brand: React.PropTypes.string, @@ -66,8 +65,11 @@ module.exports = React.createClass({ }, componentWillMount: function() { + this._unmounted = false; + if (PlatformPeg.get()) { PlatformPeg.get().getAppVersion().done((appVersion) => { + if (this._unmounted) return; this.setState({ vectorVersion: appVersion, }); @@ -90,6 +92,7 @@ module.exports = React.createClass({ }, componentWillUnmount: function() { + this._unmounted = true; dis.dispatch({ action: 'ui_opacity', sideOpacity: 1.0,