Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// We need to delay, so that the iframe gets cleared before we load a new src
//
yield delay(0);
yield put(actions.UI.ContentCanvas.setSrc(nextAction.payload.src || src));
continue;
}
if (nextAction.type === actionTypes.UI.ContentCanvas.REQUEST_LOGIN) {
yield put(actions.System.authenticationTimeout());
yield take(actionTypes.System.REAUTHENTICATION_SUCCEEDED);
//
// We need to delay, so that the iframe gets cleared before we load a new src
//
yield put(actions.UI.ContentCanvas.setSrc(''));
yield delay(0);
yield put(actions.UI.ContentCanvas.setSrc(src));
continue;
}
}
}
function* putUserInfoWorker(payload) {
try {
Toast.loading('提交中')
const response = yield call(userService.putUserInfo, payload)
yield put(action.putUserInfoSuccess(response))
Toast.success('提交成功', 1.5)
yield delay(1500)
yield put(NavigationActions.back())
} catch (error) {
yield put(action.putUserInfoFailed(error))
Toast.fail('提交失败', 1.5)
}
}
function* fetchWalletInfo(action) {
let walletInfo;
try {
walletInfo = yield call(xhr.get, action.payload);
} catch (e) {
yield delay(5000);
yield put(action);
}
yield put({ type: types.MOUNT_WALLET_INFO, payload: walletInfo.data });
}
function* postWarOrderWorker(payload) {
try {
yield put(action.fetchRequest({ text: '提交中' }))
const count = yield call(warOrderService.getWarOrderCountOfToday)
const userinfo = yield call(userService.getUserInfoToJson)
const warOrderLimit = userinfo.warOrderLimit
if (count <= warOrderLimit) {
const team = yield call(teamsService.getTeamToJson, payload)
const response = yield call(warOrderService.cerateWarOrder, payload, team)
yield put(action.fetchSuccess())
yield put(action.postWarOrderSuccess(response))
Toast.success('提交成功', 1)
yield delay(1000)
yield put(goBack())
} else {
yield put(action.postWarOrderFailed())
yield put(action.fetchFailed())
Toast.success(`1天最多发布${warOrderLimit}条比赛约战帖`, 2)
yield delay(2000)
yield put(goBack())
}
} catch (error) {
yield put(action.postWarOrderFailed(error))
yield put(action.fetchFailed())
Toast.success('提交失败', 1)
}
}
const count = yield call(warOrderService.getWarOrderCountOfToday)
const userinfo = yield call(userService.getUserInfoToJson)
const warOrderLimit = userinfo.warOrderLimit
if (count <= warOrderLimit) {
const team = yield call(teamsService.getTeamToJson, payload)
const response = yield call(warOrderService.cerateWarOrder, payload, team)
yield put(action.fetchSuccess())
yield put(action.postWarOrderSuccess(response))
Toast.success('提交成功', 1)
yield delay(1000)
yield put(goBack())
} else {
yield put(action.postWarOrderFailed())
yield put(action.fetchFailed())
Toast.success(`1天最多发布${warOrderLimit}条比赛约战帖`, 2)
yield delay(2000)
yield put(goBack())
}
} catch (error) {
yield put(action.postWarOrderFailed(error))
yield put(action.fetchFailed())
Toast.success('提交失败', 1)
}
}
function* dynamicState() {
while (true) {
yield delay(500);
yield* setSceneState({ dynamicState: Math.floor(Math.random() * 100) });
}
}