Skip to content

Commit e54fabc

Browse files
feat(overmind-devtools): show error when crashing
1 parent f342f2b commit e54fabc

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

packages/node_modules/overmind-devtools/src/components/ActionsList/styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const wrapper = css({
55
padding: '1rem',
66
height: '100%',
77
overflowY: 'scroll',
8+
boxSizing: 'border-box',
89
})
910

1011
export const actionItem = css({

packages/node_modules/overmind-devtools/src/components/Devtools/index.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ const Devtools: FunctionComponent = () => {
4949
return renderSetPort()
5050
}
5151

52+
if (state.error) {
53+
return (
54+
<div className={styles.wrapper}>
55+
<div className={styles.container}>
56+
<div className={css(text.header, text.white)}>
57+
Ops, there is an error :(
58+
</div>
59+
<div className={text.red}>{state.error}</div>
60+
</div>
61+
</div>
62+
)
63+
}
64+
5265
if (state.isConnecting) {
5366
return (
5467
<div className={styles.wrapper}>

packages/node_modules/overmind-devtools/src/overmind/operators.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export const isPortExistsMessage: (
6666
export const addStateAndActions: Operator<InitMessage> = action(
6767
({ state }, message) => {
6868
state.isConnecting = false
69+
state.error = null
6970
state.apps[message.appName].state = message.data.state
7071
state.apps[message.appName].actionPaths = message.data.actions
7172
}

0 commit comments

Comments
 (0)