diff --git a/webapp/app.jsx b/webapp/app.jsx index 9310242..eb74cf2 100644 --- a/webapp/app.jsx +++ b/webapp/app.jsx @@ -34,6 +34,7 @@ require.ensure('react', _ => { var BoardEditor = require('board-editor.jsx')(boards) var PostEditor = require('post-editor.jsx')(boards) var Status = require('status.jsx')(boards) + var Update = require('update.jsx') // Define Main Components @@ -121,6 +122,7 @@ require.ensure('react', _ => { + diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx index 9fad3f8..63383b4 100644 --- a/webapp/components/navbar.jsx +++ b/webapp/components/navbar.jsx @@ -3,20 +3,25 @@ var Icon = require('icon.jsx') var Link = require('react-router').Link var Updater = React.createClass({ + getInitialState () { + return {} + }, componentDidMount () { - if (this.props.api) this.checkForUpdates(this.props.api) + this.checkForUpdates() }, - componentWillReceiveProps (props) { - this.checkForUpdates(props.api) - }, - checkForUpdates (boards) { + checkForUpdates () { var v = window.location.pathname - if (/\/ip(f|n)s\/./.test(v)) { - // Advise user to run from another URL + var gateway = window.location.pathname.indexOf('/ipfs/') === 0 || window.location.pathname.indexOf('/ipns/') === 0 + if (v !== '/ipns/boards.ydns.eu' || !gateway) { + this.setState({ update: true }) } }, render () { - return
+ if (this.state.update) { + return + + + } else return
} }) @@ -43,7 +48,6 @@ module.exports = function (boardsAPI) { return - } else if (this.state.loading) { return @@ -59,6 +63,7 @@ module.exports = function (boardsAPI) {

Boards

+ {this.extraButtons()} diff --git a/webapp/pages/update.jsx b/webapp/pages/update.jsx new file mode 100644 index 0000000..ba18366 --- /dev/null +++ b/webapp/pages/update.jsx @@ -0,0 +1,24 @@ +var React = require('react') +var Icon = require('icon.jsx') + +module.exports = React.createClass({ + render () { + var gateway = window.location.pathname.indexOf('/ipfs/') === 0 || window.location.pathname.indexOf('/ipns/') === 0 + return
+
+

+

Version Center

+
+

This page lets you reach the latest version + of the app from any older versions. In the future, you will be able to manage + and easily access any old version of the app too, for compatibility + and archival reasons.

+

You're free to keep going, but if you want the latest updates as + soon as they are published, you can click the following button, that will + bring you to an IPFS URL that always points to the latest version.

+
+ Update +
+
+ } +})