From 0272b29ab200549ba62dcd92af1e0ad2c803370c Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Tue, 17 Mar 2020 21:27:35 +0530 Subject: [PATCH] fix loading issue --- app/client/src/sagas/ActionSagas.ts | 6 ++++-- app/client/src/sagas/ErrorSagas.tsx | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/client/src/sagas/ActionSagas.ts b/app/client/src/sagas/ActionSagas.ts index 707c30e2f6..eda4099cda 100644 --- a/app/client/src/sagas/ActionSagas.ts +++ b/app/client/src/sagas/ActionSagas.ts @@ -329,10 +329,12 @@ export function* executeAppAction(action: ReduxAction) { const { dynamicString, event, responseData } = action.payload; const tree = yield select(evaluateDataTree); const { triggers } = getDynamicValue(dynamicString, tree, responseData, true); - if (triggers) { + if (triggers && triggers.length) { yield all( triggers.map(trigger => call(executeActionTriggers, trigger, event)), ); + } else { + if (event.callback) event.callback({ success: true }); } } @@ -687,7 +689,7 @@ function* copyActionSaga( export function* watchActionSagas() { yield all([ takeEvery(ReduxActionTypes.FETCH_ACTIONS_INIT, fetchActionsSaga), - takeLatest(ReduxActionTypes.EXECUTE_ACTION, executeAppAction), + takeEvery(ReduxActionTypes.EXECUTE_ACTION, executeAppAction), takeLatest(ReduxActionTypes.RUN_API_REQUEST, runApiActionSaga), takeLatest(ReduxActionTypes.CREATE_ACTION_INIT, createActionSaga), takeLatest(ReduxActionTypes.UPDATE_ACTION_INIT, updateActionSaga), diff --git a/app/client/src/sagas/ErrorSagas.tsx b/app/client/src/sagas/ErrorSagas.tsx index b7d0f145a7..48ecb821eb 100644 --- a/app/client/src/sagas/ErrorSagas.tsx +++ b/app/client/src/sagas/ErrorSagas.tsx @@ -80,7 +80,8 @@ export function* errorSaga( type, payload: { error, show = true }, } = errorAction; - const message = error.message || ActionErrorDisplayMap[type](error); + const message = + error && error.message ? error.message : ActionErrorDisplayMap[type](error); if (show) AppToaster.show({ message, type: ToastType.ERROR }); yield put({ type: ReduxActionTypes.REPORT_ERROR,