summaryrefslogtreecommitdiff
path: root/ui/app/components
diff options
context:
space:
mode:
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)}
}