From eed9303e414013fb154aa77a0b3bb67ba32b752e Mon Sep 17 00:00:00 2001 From: MacRimi Date: Thu, 9 Apr 2026 20:50:56 +0200 Subject: [PATCH] Update script-terminal-modal.tsx --- AppImage/components/script-terminal-modal.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/AppImage/components/script-terminal-modal.tsx b/AppImage/components/script-terminal-modal.tsx index b23045e1..6571a436 100644 --- a/AppImage/components/script-terminal-modal.tsx +++ b/AppImage/components/script-terminal-modal.tsx @@ -283,12 +283,15 @@ const initMessage = { } }, 30000) - const initMessage = { - script_path: scriptPath, - params, - } - - ws.send(JSON.stringify(initMessage)) + // Small delay to ensure paramsRef is updated with latest props + setTimeout(() => { + const initMessage = { + script_path: scriptPath, + params: paramsRef.current, + } + console.log("[v0] WS onopen - Sending params:", paramsRef.current) + ws.send(JSON.stringify(initMessage)) + }, 50) setTimeout(() => { if (fitAddonRef.current && termRef.current && ws.readyState === WebSocket.OPEN) {