From 108af83ae815be6776e70b20f37f5107f29067fe Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 3 Nov 2016 11:43:50 +0000 Subject: [PATCH] Just bind the right function to the button rather than deciding in onChangelogClicked --- src/components/views/globals/NewVersionBar.js | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/components/views/globals/NewVersionBar.js b/src/components/views/globals/NewVersionBar.js index bca4e3de..36d6bc71 100644 --- a/src/components/views/globals/NewVersionBar.js +++ b/src/components/views/globals/NewVersionBar.js @@ -37,18 +37,6 @@ export default React.createClass({ releaseNotes: React.PropTypes.string, }, - onChangelogClicked: function() { - // If we have release notes to display, we display them. Otherwise, - // we display the Changelog Dialog which takes two versions and - // automatically tells you what's changed (provided the versions - // are in the right format) - if (this.props.releaseNotes) { - this.displayReleaseNotes(this.props.releaseNotes); - } else if (checkVersion(this.props.version) && checkVersion(this.props.newVersion)) { - this.displayChangelog(); - } - }, - displayReleaseNotes: function(releaseNotes) { const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog'); Modal.createDialog(QuestionDialog, { @@ -82,8 +70,14 @@ export default React.createClass({ render: function() { let action_button; - if (this.props.releaseNotes || (checkVersion(this.props.version) && checkVersion(this.props.newVersion))) { - action_button = ; + // If we have release notes to display, we display them. Otherwise, + // we display the Changelog Dialog which takes two versions and + // automatically tells you what's changed (provided the versions + // are in the right format) + if (this.props.releaseNotes) { + action_button = ; + } else if (checkVersion(this.props.version) && checkVersion(this.props.newVersion)) { + action_button = ; } else if (PlatformPeg.get()) { action_button = ; }