mirror of
https://github.com/fazo96/ipfs-boards
synced 2025-01-10 12:24:20 +01:00
settings page now shows limited mode info
This commit is contained in:
parent
6bbd1377ec
commit
6f71134301
@ -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 <div className="itsok light">
|
||||
<h5><Icon name="exclamation-triangle" /> Limited Mode</h5>
|
||||
<p>Some features may not be available.</p>
|
||||
</div>
|
||||
} else if (this.state.api) {
|
||||
return <div className="itsok light">
|
||||
<h5><Icon name="check" /> It's OK</h5>
|
||||
<p>You're connected to IPFS</p>
|
||||
</div>
|
||||
}
|
||||
} else return <div></div>
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user