diff --git a/package.json b/package.json index 9e3450cdc..be87139b2 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,7 @@ "react-gemini-scrollbar": "matrix-org/react-gemini-scrollbar#5e97aef", "sanitize-html": "^1.11.1", "ua-parser-js": "^0.7.10", - "url": "^0.11.0", - "whatwg-fetch": "^1.0.0" + "url": "^0.11.0" }, "devDependencies": { "babel": "^5.8.23", diff --git a/src/components/views/dialogs/ChangelogDialog.js b/src/components/views/dialogs/ChangelogDialog.js index 96ae63655..823c205b8 100644 --- a/src/components/views/dialogs/ChangelogDialog.js +++ b/src/components/views/dialogs/ChangelogDialog.js @@ -17,6 +17,7 @@ import React from 'react'; import sdk from 'matrix-react-sdk'; import 'whatwg-fetch'; +import request from 'browser-request'; const REPOS = ['vector-im/vector-web', 'matrix-org/matrix-react-sdk', 'matrix-org/matrix-js-sdk']; @@ -28,17 +29,16 @@ export default class ChangelogDialog extends React.Component { } componentDidMount() { - console.log(this.props); - const version = this.props.newVersion; - const version2 = this.props.version; + const version = this.props.newVersion.split('-'); + const version2 = this.props.version.split('-'); if(version == null || version2 == null) return; for(let i=0; i response.json()) - .then(json => this.setState({[REPOS[i]]: json.commits})); - + request(`https://api.github.com/repos/${REPOS[i]}/compare/${oldVersion}...${newVersion}`, (a, b, body) => { + 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 62d755a6a..8d819323a 100644 --- a/src/components/views/globals/NewVersionBar.js +++ b/src/components/views/globals/NewVersionBar.js @@ -23,7 +23,7 @@ import Modal from 'matrix-react-sdk/lib/Modal'; export default function NewVersionBar(props) { const onChangelogClicked = () => { const ChangelogDialog = sdk.getComponent('dialogs.ChangelogDialog'); - console.log(props); + Modal.createDialog(ChangelogDialog, { version: props.version, newVersion: props.newVersion, @@ -38,10 +38,10 @@ export default function NewVersionBar(props) { return (
/!\ -
+
A new version of Vector is available. Refresh your browser.
- +
); } diff --git a/src/skins/vector/css/vector-web/views/globals/MatrixToolbar.css b/src/skins/vector/css/vector-web/views/globals/MatrixToolbar.css index a8297f46c..4e214e113 100644 --- a/src/skins/vector/css/vector-web/views/globals/MatrixToolbar.css +++ b/src/skins/vector/css/vector-web/views/globals/MatrixToolbar.css @@ -54,3 +54,7 @@ limitations under the License. float: right; margin-right: 10px; } + +.mx_MatrixToolbar_action { + margin-right: 16px; +}