diff options
Diffstat (limited to 'subprojects/frontend/src/xtext/webSocketMachine.ts')
-rw-r--r-- | subprojects/frontend/src/xtext/webSocketMachine.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/subprojects/frontend/src/xtext/webSocketMachine.ts b/subprojects/frontend/src/xtext/webSocketMachine.ts index 216ed86a..fc53fef3 100644 --- a/subprojects/frontend/src/xtext/webSocketMachine.ts +++ b/subprojects/frontend/src/xtext/webSocketMachine.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import ms from 'ms'; | 1 | import ms from 'ms'; |
2 | import { actions, assign, createMachine, RaiseAction } from 'xstate'; | 2 | import { actions, assign, createMachine } from 'xstate'; |
3 | 3 | ||
4 | const { raise } = actions; | 4 | const { raise } = actions; |
5 | 5 | ||
@@ -217,16 +217,15 @@ export default createMachine( | |||
217 | ...context, | 217 | ...context, |
218 | errors: [], | 218 | errors: [], |
219 | })), | 219 | })), |
220 | // Workaround from https://github.com/statelyai/xstate/issues/1414#issuecomment-699972485 | ||
221 | raiseTimeoutError: raise({ | 220 | raiseTimeoutError: raise({ |
222 | type: 'ERROR', | 221 | type: 'ERROR', |
223 | message: 'Open timeout', | 222 | message: 'Open timeout', |
224 | }) as RaiseAction<WebSocketEvent>, | 223 | }), |
225 | raisePromiseRejectionError: (_context, { data }) => | 224 | raisePromiseRejectionError: (_context, { data }) => |
226 | raise({ | 225 | raise<WebSocketContext, WebSocketEvent>({ |
227 | type: 'ERROR', | 226 | type: 'ERROR', |
228 | message: data, | 227 | message: String(data), |
229 | }) as RaiseAction<WebSocketEvent>, | 228 | }), |
230 | }, | 229 | }, |
231 | }, | 230 | }, |
232 | ); | 231 | ); |