Skip to content

Commit a2c22c6

Browse files
committed
Support marking preview as not preview in VSCode
1 parent 30f1fcb commit a2c22c6

File tree

1 file changed

+6
-0
lines changed
  • packages/app/src/app/store/modules/editor

1 file changed

+6
-0
lines changed

packages/app/src/app/store/modules/editor/actions.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import slugify from '@codesandbox/common/lib/utils/slugify';
33
import { clone } from 'mobx-state-tree';
44
import { dispatch } from 'codesandbox-api';
55

6+
import vscode from 'app/vscode';
7+
68
import getTemplate from '@codesandbox/common/lib/templates';
79
import { getTemplate as computeTemplate } from 'codesandbox-import-utils/lib/create-sandbox/templates';
810

@@ -321,6 +323,10 @@ export function moveTab({ state, props }) {
321323
}
322324

323325
export function unsetDirtyTab({ state }) {
326+
if (state.get('preferences.settings.experimentVSCode')) {
327+
vscode.runCommand('workbench.action.keepEditor');
328+
}
329+
324330
const currentModule = state.get('editor.currentModule');
325331
const tabs = state.get('editor.tabs');
326332
const tabIndex = tabs.findIndex(

0 commit comments

Comments
 (0)