fix loading issue

This commit is contained in:
Hetu Nandu 2020-03-17 21:27:35 +05:30
parent d42d40dd6d
commit 0272b29ab2
2 changed files with 6 additions and 3 deletions

View File

@ -329,10 +329,12 @@ export function* executeAppAction(action: ReduxAction<ExecuteActionPayload>) {
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),

View File

@ -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,