From 6f711343010fdf94f3daf94cbe7a6822017a9d56 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Sun, 20 Dec 2015 12:04:46 +0100 Subject: [PATCH] settings page now shows limited mode info --- webapp/pages/settings.jsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/webapp/pages/settings.jsx b/webapp/pages/settings.jsx index fbb0a0e..f7f7fd3 100644 --- a/webapp/pages/settings.jsx +++ b/webapp/pages/settings.jsx @@ -9,8 +9,10 @@ module.exports = function (boardsAPI) { getInitialState: function () { boardsAPI.use(boards => { if (boards.isInit && this.isMounted()) this.setState({ api: true }) - boards.getEventEmitter().on('init', err => { - if (!err && this.isMounted()) this.setState({ api: true }) + boards.getEventEmitter().on('init', (err, limited) => { + if ((!err || limited) && this.isMounted()) { + this.setState({ api: true, limited }) + } }) }) var s = window.localStorage.getItem('ipfs-boards-settings') @@ -44,12 +46,17 @@ module.exports = function (boardsAPI) { } }, isOK: function () { - if (this.state.api) { + if (this.state.limited) { + return
+
Limited Mode
+

Some features may not be available.

+
+ } else if (this.state.api) { return
It's OK

You're connected to IPFS

- } + } else return
}, render: function () { return (