Skip to content

Commit 70d383f

Browse files
committed
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.
1 parent b0c1097 commit 70d383f

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎src/components/views/dialogs/ChangelogDialog.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ export default class ChangelogDialog extends React.Component {
3131
const version = this.props.newVersion.split('-');
3232
const version2 = this.props.version.split('-');
3333
if(version == null || version2 == null) return;
34+
// parse versions of form: [vectorversion]-react-[react-sdk-version]-js-[js-sdk-version]
3435
for(let i=0; i<REPOS.length; i++) {
35-
const oldVersion = version2[2*i+1];
36-
const newVersion = version[2*i+1];
36+
const oldVersion = version2[2*i];
37+
const newVersion = version[2*i];
3738
request(`https://api.github.com/repos/${REPOS[i]}/compare/${oldVersion}...${newVersion}`, (a, b, body) => {
3839
if(body == null) return;
3940
this.setState({[REPOS[i]]: JSON.parse(body).commits});

‎src/components/views/globals/NewVersionBar.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg';
2323

2424
/**
2525
* Check a version string is compatible with the Changelog
26-
* dialog
26+
* dialog ([vectorversion]-react-[react-sdk-version]-js-[js-sdk-version])
2727
*/
2828
function checkVersion(ver) {
2929
const parts = ver.split('-');
30-
return parts[0] == 'vector' && parts[2] == 'react' && parts[4] == 'js';
30+
return parts.length == 5 && parts[1] == 'react' && parts[3] == 'js';
3131
}
3232

3333
export default React.createClass({

0 commit comments

Comments
 (0)