diff --git a/app/client/src/sagas/InitSagas.ts b/app/client/src/sagas/InitSagas.ts index 27956999e8..72c544d49c 100644 --- a/app/client/src/sagas/InitSagas.ts +++ b/app/client/src/sagas/InitSagas.ts @@ -148,10 +148,22 @@ function* updateURLSaga(action: ReduxURLChangeAction) { }); } +function* appEngineSaga(action: ReduxAction) { + yield race({ + task: call(startAppEngine, action), + cancel: take(ReduxActionTypes.RESET_EDITOR_REQUEST), + }); +} + export default function* watchInitSagas() { yield all([ - takeLatest(ReduxActionTypes.INITIALIZE_EDITOR, startAppEngine), - takeLatest(ReduxActionTypes.INITIALIZE_PAGE_VIEWER, startAppEngine), + takeLatest( + [ + ReduxActionTypes.INITIALIZE_EDITOR, + ReduxActionTypes.INITIALIZE_PAGE_VIEWER, + ], + appEngineSaga, + ), takeLatest(ReduxActionTypes.RESET_EDITOR_REQUEST, resetEditorSaga), takeEvery(URL_CHANGE_ACTIONS, updateURLSaga), ]);