From a22b1cb9f58458f8f1986b1152658f46396cc258 Mon Sep 17 00:00:00 2001 From: sawka Date: Thu, 5 Sep 2024 19:25:52 -0700 Subject: [PATCH] fix reconnect suggestion --- frontend/app/block/blockframe.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/app/block/blockframe.tsx b/frontend/app/block/blockframe.tsx index 40ac9d7f7..b58c61f99 100644 --- a/frontend/app/block/blockframe.tsx +++ b/frontend/app/block/blockframe.tsx @@ -450,10 +450,10 @@ const ChangeConnectionBlockModal = React.memo( const changeConnModalOpen = jotai.useAtomValue(changeConnModalAtom); const [blockData] = WOS.useWaveObjectValue(WOS.makeORef("block", blockId)); const isNodeFocused = jotai.useAtomValue(nodeModel.isFocused); - const connection = blockData?.meta?.connection ?? "local"; + const connection = blockData?.meta?.connection; const connStatusAtom = getConnStatusAtom(connection); const connStatus = jotai.useAtomValue(connStatusAtom); - const [suggestions, setSuggestions] = React.useState([]); + const [suggestions, setSuggestions] = React.useState([]); const changeConnection = React.useCallback( async (connName: string) => { if (connName == "") { @@ -527,7 +527,8 @@ const ChangeConnectionBlockModal = React.memo( label: `Reconnect to ${connStatus.connection}`, value: "", onSelect: async (_: string) => { - console.log("unimplemented: reconnect"); + const prtn = WshServer.ConnConnectCommand(connStatus.connection, { timeout: 60000 }); + prtn.catch((e) => console.log("error reconnecting", connStatus.connection, e)); }, }; const priorityItems: Array = [];