fix: hide pages when switching to preview mode via topbar button (#4740)

closes https://github.com/webstudio-is/webstudio/issues/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
This commit is contained in:
Oleg Isonen authored and GitHub committed 2025-01-10 20:30:51 +01:00
1 parent e27628cfd9
commit 313015e364
1 file changed
+2 -2
@@ -33,10 +33,10 @@ import {
$isDesignModeAllowed,
isBuilderMode,
setBuilderMode,
toggleBuilderMode,
} from "~/shared/nano-states";
import { useState } from "react";
import { isFeatureEnabled } from "@webstudio-is/feature-flags";
import { emitCommand } from "~/builder/shared/commands";
export const BuilderModeDropDown = () => {
const builderMode = useStore($builderMode);
@@ -86,7 +86,7 @@ export const BuilderModeDropDown = () => {
type="single"
value={builderMode}
onValueChange={() => {
toggleBuilderMode("preview");
emitCommand("togglePreviewMode");
}}
>
<ToolbarToggleItem variant="preview" value="preview">