mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-12-15 00:26:23 +00:00
Update script-terminal-modal.tsx
This commit is contained in:
@@ -62,10 +62,16 @@ export function ScriptTerminalModal({
|
|||||||
params,
|
params,
|
||||||
sessionId,
|
sessionId,
|
||||||
})
|
})
|
||||||
setCurrentInteraction(null)
|
// Reset state only when modal opens
|
||||||
|
setIsComplete(false)
|
||||||
|
setExitCode(null)
|
||||||
setInteractionInput("")
|
setInteractionInput("")
|
||||||
|
// Don't clear currentInteraction here - it causes issues
|
||||||
|
} else {
|
||||||
|
// Clear interaction when modal closes
|
||||||
|
setCurrentInteraction(null)
|
||||||
}
|
}
|
||||||
}, [open, scriptPath, scriptName, params, sessionId])
|
}, [open]) // Only depend on 'open' to avoid unnecessary re-runs
|
||||||
|
|
||||||
const getScriptWebSocketUrl = (): string => {
|
const getScriptWebSocketUrl = (): string => {
|
||||||
if (typeof window === "undefined") {
|
if (typeof window === "undefined") {
|
||||||
@@ -82,7 +88,7 @@ export function ScriptTerminalModal({
|
|||||||
const handleWebInteraction = (interaction: WebInteraction) => {
|
const handleWebInteraction = (interaction: WebInteraction) => {
|
||||||
console.log("[v0] handleWebInteraction called with:", interaction)
|
console.log("[v0] handleWebInteraction called with:", interaction)
|
||||||
setCurrentInteraction(interaction)
|
setCurrentInteraction(interaction)
|
||||||
console.log("[v0] setCurrentInteraction called with interaction")
|
console.log("[v0] currentInteraction set to:", interaction.type, interaction.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleInteractionResponse = (value: string) => {
|
const handleInteractionResponse = (value: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user