Skip to content

Commit 1bdf470

Browse files
fix(web): project actions auto-open Preview in web clients (#34048)
1 parent 5bb5d53 commit 1bdf470

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎apps/web/src/components/chat/useChatTerminalActions.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import {
2828
type RightPanelSurface,
2929
useRightPanelStore,
3030
} from "../../rightPanelStore";
31-
import { isPreviewSupportedInRuntime } from "../../previewStateStore";
3231
import { openUrlInPreview } from "../../browser/openFileInPreview";
32+
import { isPreviewAvailableFor } from "../../browser/previewRuntime";
3333
import { resolveDiscoveredServerUrl } from "../../browser/browserTargetResolver";
3434
import { stackedThreadToast, toastManager } from "../ui/toast";
3535
import { confirmTerminalClose } from "../../lib/terminalCloseConfirm";
@@ -290,7 +290,11 @@ export function useChatTerminalActions(input: ChatTerminalActionsInput) {
290290
}
291291
return;
292292
}
293-
if (script.autoOpenPreview && script.previewUrl && isPreviewSupportedInRuntime()) {
293+
if (
294+
script.autoOpenPreview &&
295+
script.previewUrl &&
296+
isPreviewAvailableFor(activeThreadRef.environmentId)
297+
) {
294298
const previewResult = await openUrlInPreview({
295299
threadRef: activeThreadRef,
296300
url: resolveDiscoveredServerUrl(activeThreadRef.environmentId, script.previewUrl),

0 commit comments

Comments
 (0)