From 70d383fb1bfb65516d52e209354434a78e267ef7 Mon Sep 17 00:00:00 2001 From: David Baker Date: Sun, 13 Nov 2016 23:06:57 +0000 Subject: [PATCH] Fix changelog dialog to read new version format Remove the 'vector' from the start of the version (otherwise the tarballs are called vector-vector-[...].tar.gz). The jenkins script already creates these files, so update accordingly. --- src/components/views/dialogs/ChangelogDialog.js | 5 +++-- src/components/views/globals/NewVersionBar.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/views/dialogs/ChangelogDialog.js b/src/components/views/dialogs/ChangelogDialog.js index 6bc6de60..d14d8dc2 100644 --- a/src/components/views/dialogs/ChangelogDialog.js +++ b/src/components/views/dialogs/ChangelogDialog.js @@ -31,9 +31,10 @@ export default class ChangelogDialog extends React.Component { const version = this.props.newVersion.split('-'); const version2 = this.props.version.split('-'); if(version == null || version2 == null) return; + // parse versions of form: [vectorversion]-react-[react-sdk-version]-js-[js-sdk-version] for(let i=0; i { if(body == null) return; this.setState({[REPOS[i]]: JSON.parse(body).commits}); diff --git a/src/components/views/globals/NewVersionBar.js b/src/components/views/globals/NewVersionBar.js index 36d6bc71..3e03be72 100644 --- a/src/components/views/globals/NewVersionBar.js +++ b/src/components/views/globals/NewVersionBar.js @@ -23,11 +23,11 @@ import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg'; /** * Check a version string is compatible with the Changelog - * dialog + * dialog ([vectorversion]-react-[react-sdk-version]-js-[js-sdk-version]) */ function checkVersion(ver) { const parts = ver.split('-'); - return parts[0] == 'vector' && parts[2] == 'react' && parts[4] == 'js'; + return parts.length == 5 && parts[1] == 'react' && parts[3] == 'js'; } export default React.createClass({