Skip to content

Commit 4c7654f

Browse files
pshrmnCompuIves
authored andcommitted
Redirect to sandbox wizard when deleting sandbox (codesandbox#1313)
* Redirect to sandbox wizard when deleting sandbox * Replace location when deleting * Trailing slash
1 parent f91f152 commit 4c7654f

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
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
},

0 commit comments

Comments
 (0)