fix(command-dropdown): preserve running command status across folder switches

This commit is contained in:
xintaofei
2026-04-23 11:45:25 +08:00
parent e489925567
commit 377ae6d8e6

View File

@@ -110,11 +110,9 @@ export function CommandDropdown() {
useEffect(() => { useEffect(() => {
if (!folderId) { if (!folderId) {
setSelectedCommandIdState(null) setSelectedCommandIdState(null)
setRunningCommandTerminals({})
return return
} }
setSelectedCommandIdState(getSelectedCommandId(folderId)) setSelectedCommandIdState(getSelectedCommandId(folderId))
setRunningCommandTerminals({})
}, [folderId]) }, [folderId])
const refreshCommands = useCallback(async () => { const refreshCommands = useCallback(async () => {