Skip to content

Commit 313015e

Browse files
authored
fix: hide pages when switching to preview mode via topbar button (#4740)
closes #4647 ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent e27628c commit 313015e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/builder/app/builder/features/topbar/builder-mode.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ import {
3333
$isDesignModeAllowed,
3434
isBuilderMode,
3535
setBuilderMode,
36-
toggleBuilderMode,
3736
} from "~/shared/nano-states";
3837
import { useState } from "react";
3938
import { isFeatureEnabled } from "@webstudio-is/feature-flags";
39+
import { emitCommand } from "~/builder/shared/commands";
4040

4141
export const BuilderModeDropDown = () => {
4242
const builderMode = useStore($builderMode);
@@ -86,7 +86,7 @@ export const BuilderModeDropDown = () => {
8686
type="single"
8787
value={builderMode}
8888
onValueChange={() => {
89-
toggleBuilderMode("preview");
89+
emitCommand("togglePreviewMode");
9090
}}
9191
>
9292
<ToolbarToggleItem variant="preview" value="preview">

0 commit comments

Comments
 (0)