Skip to content

Commit 10d4f5c

Browse files
committed
Merge branch 'master' of github.com:CompuIves/codesandbox-client
2 parents 0a69f21 + 4c7654f commit 10d4f5c

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ export function redirectToNewSandbox({ router }) {
2727
router.redirectToNewSandbox();
2828
}
2929

30+
export function redirectToSandboxWizard({ router }) {
31+
router.redirectToSandboxWizard();
32+
}
33+
3034
export function updateSandbox({ api, state }) {
3135
const sandboxId = state.get('editor.currentId');
3236
const body = {

packages/app/src/app/store/modules/workspace/sequences.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ export const deleteSandbox = [
3939
actions.deleteSandbox,
4040
set(state`workspace.showDeleteSandboxModal`, false),
4141
addNotification('Sandbox deleted!', 'success'),
42-
actions.redirectToNewSandbox,
43-
set(props`id`, 'new'),
44-
loadSandbox,
42+
actions.redirectToSandboxWizard,
4543
];
4644

4745
export const openIntegrations = [

packages/app/src/app/store/providers/Router.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export default Provider({
1010
redirectToNewSandbox() {
1111
history.push('/s/new');
1212
},
13+
redirectToSandboxWizard() {
14+
history.replace('/s/');
15+
},
1316
getSandboxOptions() {
1417
return getSandboxOptions(decodeURIComponent(document.location.href));
1518
},

packages/app/src/embed/components/App/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default class App extends React.PureComponent<{}, State> {
7979
forceRefresh,
8080
expandDevTools,
8181
runOnClick,
82-
verticalMode,
82+
verticalMode = window.innerWidth < window.innerHeight,
8383
tabs,
8484
} = getSandboxOptions(document.location.href);
8585

packages/common/__snapshots__/url.test.js.snap

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Object {
1616
"isTestPreviewWindow": false,
1717
"runOnClick": undefined,
1818
"useCodeMirror": false,
19-
"verticalMode": false,
2019
}
2120
`;
2221

@@ -37,7 +36,6 @@ Object {
3736
"isTestPreviewWindow": false,
3837
"runOnClick": undefined,
3938
"useCodeMirror": false,
40-
"verticalMode": false,
4139
}
4240
`;
4341

@@ -57,7 +55,6 @@ Object {
5755
"isTestPreviewWindow": false,
5856
"runOnClick": undefined,
5957
"useCodeMirror": false,
60-
"verticalMode": false,
6158
}
6259
`;
6360

@@ -77,7 +74,6 @@ Object {
7774
"isTestPreviewWindow": false,
7875
"runOnClick": undefined,
7976
"useCodeMirror": false,
80-
"verticalMode": false,
8177
}
8278
`;
8379

@@ -97,7 +93,6 @@ Object {
9793
"isTestPreviewWindow": false,
9894
"runOnClick": undefined,
9995
"useCodeMirror": false,
100-
"verticalMode": false,
10196
}
10297
`;
10398

@@ -118,7 +113,6 @@ Object {
118113
"isTestPreviewWindow": false,
119114
"runOnClick": undefined,
120115
"useCodeMirror": false,
121-
"verticalMode": false,
122116
}
123117
`;
124118

@@ -138,7 +132,6 @@ Object {
138132
"isTestPreviewWindow": false,
139133
"runOnClick": undefined,
140134
"useCodeMirror": false,
141-
"verticalMode": false,
142135
}
143136
`;
144137

@@ -158,6 +151,5 @@ Object {
158151
"isTestPreviewWindow": false,
159152
"runOnClick": undefined,
160153
"useCodeMirror": false,
161-
"verticalMode": false,
162154
}
163155
`;

packages/common/url.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ export const getSandboxOptions = (url: string) => {
7373
result.enableEslint = url.includes('eslint=1');
7474
result.forceRefresh = url.includes('forcerefresh=1');
7575
result.expandDevTools = url.includes('expanddevtools=1');
76-
result.verticalMode = url.includes('verticallayout=1');
76+
if (url.includes('verticallayout=')) {
77+
result.verticalMode = url.includes('verticallayout=1');
78+
}
79+
console.log(result);
7780
result.runOnClick = url.includes('runonclick=0')
7881
? false
7982
: url.includes('runonclick=1')

0 commit comments

Comments
 (0)