diff --git a/lib/boards-api.js b/lib/boards-api.js index 414583b..fb22b51 100644 --- a/lib/boards-api.js +++ b/lib/boards-api.js @@ -68,7 +68,7 @@ BoardsAPI.prototype.resolveIPNS = function(n,handler){ this.ipfs.name.resolve(n,(err,r) => { setTimeout(_ => { console.log('Launching automatic check for IPNS address',n) - this.prototype.resolveIPNS(n) + this.resolveIPNS(n) },20*1000) if(!err) console.log('Resolved',n,'to',r.Path) if(err){ diff --git a/webapp/app.jsx b/webapp/app.jsx index 4ef1924..81dec6a 100644 --- a/webapp/app.jsx +++ b/webapp/app.jsx @@ -9,9 +9,6 @@ var ipfs = require('ipfs-api')('localhost',5001) var BoardsAPI = require('../lib/boards-api.js') var boards = new BoardsAPI(ipfs) -boards.init(_ => { - console.log('Boards init complete') -}) var Container = React.createClass({ render: function(){ @@ -160,14 +157,39 @@ var Board = React.createClass({ } }) -ReactDOM.render( - - - - - - - - - , document.getElementById('root') -) +var GetIPFS = React.createClass({ + render: function(){ + return ( +
+

Missing IPFS Node

+

You don't have an IPFS node running at localhost:5001 + or it is not reachable

+

The IPFS Boards prototype requires a full IPFS node running at localhost. + Please start one by following the + go-ipfs documentation.

+

If you have a running node but still this doesn't work, it's probably a CORS issue

+

You can find out how to fix CORS issues related to this app here.

+

Still can't fix it? File a issue on GitHub, we'll be happy to help!

+
+ ) + } +}) + +boards.init(err => { + if(err){ + console.log('FATAL: IPFS NODE NOT AVAILABLE') + ReactDOM.render(, document.getElementById('root')) + } else { + ReactDOM.render( + + + + + + + + + , document.getElementById('root') + ) + } +}) diff --git a/webapp/style.css b/webapp/style.css index f171274..d135d60 100644 --- a/webapp/style.css +++ b/webapp/style.css @@ -6,6 +6,10 @@ top: 20%; } +.text-center { + text-align: center +} + .light { color: #ababab }