Redirect to sandbox wizard when deleting sandbox#1313
Redirect to sandbox wizard when deleting sandbox#1313CompuIves merged 3 commits intocodesandbox:masterfrom pshrmn:delete-redirect
Conversation
| addNotification('Sandbox deleted!', 'success'), | ||
| actions.redirectToNewSandbox, | ||
| set(props`id`, 'new'), | ||
| loadSandbox, |
There was a problem hiding this comment.
These two actions can be removed, correct? I'm not familiar enough with the architecture, but I believe that they are only used when loading a sandbox.
| history.push('/s/new'); | ||
| }, | ||
| redirectToSandboxWizard() { | ||
| history.push('/s'); |
There was a problem hiding this comment.
This might be better as a replace instead of push. Is there ever a reason that the user should be able to return to a deleted sandbox? Is there defined behavior for this?
There was a problem hiding this comment.
I agree, we should make it a replace.
CompuIves
left a comment
There was a problem hiding this comment.
This is a great PR, long overdue. Thanks for making it! I left one small comment, after that it's ready for merge.
| history.push('/s/new'); | ||
| }, | ||
| redirectToSandboxWizard() { | ||
| history.push('/s'); |
There was a problem hiding this comment.
I agree, we should make it a replace.
|
Oops, clicked approve by accident 😅. |
|
Thanks a lot @pshrmn! |
|
There were still lint errors... 😟 |
|
Fixed! |
Redirect to sandbox wizard when deleting sandbox (codesandbox#1313) * Redirect to sandbox wizard when deleting sandbox * Replace location when deleting * Trailing slash diff --git a/packages/app/src/app/store/modules/workspace/actions.js b/packages/app/src/app/store/modules/workspace/actions.js index f34698c..6444702 100644 --- a/packages/app/src/app/store/modules/workspace/actions.js +++ b/packages/app/src/app/store/modules/workspace/actions.js @@ -27,6 +27,10 @@ export function redirectToNewSandbox({ router }) { router.redirectToNewSandbox(); } +export function redirectToSandboxWizard({ router }) { + router.redirectToSandboxWizard(); +} + export function updateSandbox({ api, state }) { const sandboxId = state.get('editor.currentId'); const body = { diff --git a/packages/app/src/app/store/modules/workspace/sequences.js b/packages/app/src/app/store/modules/workspace/sequences.js index 3cfdbc1..17e097f 100644 --- a/packages/app/src/app/store/modules/workspace/sequences.js +++ b/packages/app/src/app/store/modules/workspace/sequences.js @@ -39,9 +39,7 @@ export const deleteSandbox = [ actions.deleteSandbox, set(state`workspace.showDeleteSandboxModal`, false),
* Redirect to sandbox wizard when deleting sandbox * Replace location when deleting * Trailing slash
What kind of change does this PR introduce?
This PR changes where the user is redirected after deleting a sandbox.
Fixes #1312
What is the current behavior?
The user is redirected to the new React template (
/s/new).What is the new behavior?
The user is redirected to the sandbox wizard (
/s).Checklist: