diff --git a/desktop/plugins/public/ui-debugger/components/StreamInterceptorErrorView.tsx b/desktop/plugins/public/ui-debugger/components/StreamInterceptorErrorView.tsx index d8ea47e88..0d2c66609 100644 --- a/desktop/plugins/public/ui-debugger/components/StreamInterceptorErrorView.tsx +++ b/desktop/plugins/public/ui-debugger/components/StreamInterceptorErrorView.tsx @@ -7,30 +7,19 @@ * @format */ -import {Button, Result} from 'antd'; +import {Result} from 'antd'; import * as React from 'react'; export function StreamInterceptorErrorView({ - retryCallback, + button, title, message, }: { title: string; message: string; - retryCallback?: () => void; + button: React.ReactNode; }): React.ReactElement { return ( - - Retry - - ) - } - /> + ); } diff --git a/desktop/plugins/public/ui-debugger/components/main.tsx b/desktop/plugins/public/ui-debugger/components/main.tsx index 821918215..bd9f9e4bc 100644 --- a/desktop/plugins/public/ui-debugger/components/main.tsx +++ b/desktop/plugins/public/ui-debugger/components/main.tsx @@ -50,11 +50,16 @@ export function Component() { setBottomPanelComponent(undefined); }; - if (streamState.state === 'UnrecoverableError') { + if (streamState.state === 'FatalError') { return ( + Reset + + } /> ); } @@ -64,7 +69,11 @@ export function Component() { + Retry + + } /> ); } diff --git a/desktop/plugins/public/ui-debugger/index.tsx b/desktop/plugins/public/ui-debugger/index.tsx index 6caa88d7a..9e4a9cf5b 100644 --- a/desktop/plugins/public/ui-debugger/index.tsx +++ b/desktop/plugins/public/ui-debugger/index.tsx @@ -136,7 +136,16 @@ export function plugin(client: PluginClient) { error, ); - uiState.streamState.set({state: 'UnrecoverableError'}); + uiState.streamState.set({ + state: 'FatalError', + error: error, + clearCallBack: async () => { + uiState.streamState.set({state: 'Ok'}); + nodesAtom.set(new Map()); + frameworkEvents.set(new Map()); + snapshot.set(null); + }, + }); } } diff --git a/desktop/plugins/public/ui-debugger/types.tsx b/desktop/plugins/public/ui-debugger/types.tsx index 7a02b670f..1e2dcf09a 100644 --- a/desktop/plugins/public/ui-debugger/types.tsx +++ b/desktop/plugins/public/ui-debugger/types.tsx @@ -16,7 +16,9 @@ export type StreamState = retryCallback: () => Promise; } | { - state: 'UnrecoverableError'; + state: 'FatalError'; + error: Error; + clearCallBack: () => Promise; }; export type Events = {