summaryrefslogtreecommitdiff
path: root/ui/app/components
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-12-26 18:25:58 -0800
committerKali Kaneko (leap communications) <kali@leap.se>2016-12-29 03:10:03 +0100
commit38fc7da2a9cff329c3b4975d9f01c16c10b572e9 (patch)
tree90acbc081a959eafac71c64c8cbb483d5b1d1b3c /ui/app/components
parent3461fb49985413bb578af511bf0d13efbc25b5b6 (diff)
[feature] add support for authenticated API to bitmask.js
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/error_panel.js14
-rw-r--r--ui/app/components/panel_switcher.js4
2 files changed, 15 insertions, 3 deletions
diff --git a/ui/app/components/error_panel.js b/ui/app/components/error_panel.js
index fc88d45..7b36044 100644
--- a/ui/app/components/error_panel.js
+++ b/ui/app/components/error_panel.js
@@ -9,11 +9,21 @@ export default class ErrorPanel extends React.Component {
}
render () {
+ var error_msg = null
+ var error = this.props.error
+ console.log(error)
+ if (error instanceof Error && error.stack) {
+ error_msg = error.stack
+ } else if (error instanceof PromiseRejectionEvent) {
+ error_msg = "Error connecting to bitmaskd"
+ } else {
+ error_msg = error.toString()
+ }
return (
- <Center width="400">
+ <Center width="600">
<Area>
<h1>Error</h1>
- {this.props.error}
+ {error_msg}
</Area>
</Center>
)
diff --git a/ui/app/components/panel_switcher.js b/ui/app/components/panel_switcher.js
index 0e3f0dc..d707a60 100644
--- a/ui/app/components/panel_switcher.js
+++ b/ui/app/components/panel_switcher.js
@@ -2,6 +2,7 @@ import React from 'react'
import ReactDOM from 'react-dom'
import DebugPanel from './debug_panel'
+import ErrorPanel from './error_panel'
import Splash from './splash'
import GreeterPanel from './greeter_panel'
import MainPanel from './main_panel'
@@ -35,7 +36,7 @@ export default class PanelSwitcher extends React.Component {
)
}
if (this.state.debug && this.state.panel) {
- window.location.hash = this.state.panel
+ //window.location.hash = this.state.panel
//elems.push(
// elem(DebugPanel, {key: 'debug'})
//)
@@ -57,5 +58,6 @@ export default class PanelSwitcher extends React.Component {
render_greeter(props) {return elem(GreeterPanel, props)}
render_main(props) {return elem(MainPanel, props)}
render_addressbook(props) {return elem(Addressbook, props)}
+ render_error(props) {return elem(ErrorPanel, props)}
}