Skip to content

Commit 1f256e5

Browse files
author
Ives van Hoorne
committed
Error bundling handling
1 parent 5d4a254 commit 1f256e5

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/app/store/entities/sandboxes/actions.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export const SET_NPM_DEPENDENCIES = 'SET_NPM_DEPENDENCIES';
8282
export const SET_EXTERNAL_RESOURCES = 'SET_EXTERNAL_RESOURCES';
8383
export const SET_CURRENT_MODULE = 'SET_CURRENT_MODULE';
8484
export const SET_BUNDLE = 'SET_BUNDLE';
85+
export const CANCEL_BUNDLE = 'CANCEL_BUNDLE';
8586
export const SET_PROJECT_VIEW = 'SET_PROJECT_VIEW';
8687
export const SET_VIEW_MODE = 'SET_VIEW_MODE';
8788
export const CREATE_ZIP = 'CREATE_ZIP';
@@ -608,6 +609,11 @@ export default {
608609
'error',
609610
),
610611
);
612+
613+
dispatch({
614+
type: CANCEL_BUNDLE,
615+
id: sandboxId,
616+
});
611617
}
612618
},
613619

src/app/store/entities/sandboxes/reducer.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
SET_EXTERNAL_RESOURCES,
1010
SET_CURRENT_MODULE,
1111
SET_BUNDLE,
12+
CANCEL_BUNDLE,
1213
FETCH_BUNDLE_API_ACTIONS,
1314
SET_SANDBOX_INFO,
1415
SET_PROJECT_VIEW,
@@ -81,6 +82,13 @@ function singleSandboxReducer(sandbox, action: Action) {
8182
...sandbox,
8283
dependencyBundle: action.bundle,
8384
};
85+
case CANCEL_BUNDLE:
86+
return {
87+
...sandbox,
88+
dependencyBundle: {
89+
error: true,
90+
},
91+
};
8492
case SET_SANDBOX_INFO:
8593
return {
8694
...sandbox,
@@ -103,6 +111,7 @@ export default function reducer(state = initialState, action: Action) {
103111
case SET_CURRENT_MODULE:
104112
case FETCH_BUNDLE_API_ACTIONS.REQUEST:
105113
case SET_BUNDLE:
114+
case CANCEL_BUNDLE:
106115
case SET_SANDBOX_INFO:
107116
case SET_PROJECT_VIEW:
108117
case SET_VIEW_MODE:

0 commit comments

Comments
 (0)