Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { outpoint } = makeSelectFileInfoForUri(uri)(state) || '';
const { nout, txid } = makeSelectClaimForUri(uri)(state);
const claimOutpoint = `${txid}:${nout}`;
const actions = [];
actions.push(doHideModal());
actions.push(doDeleteFile(outpoint || claimOutpoint, deleteFromComputer, abandonClaim));
if (playingUri === uri) {
actions.push(doSetPlayingUri(null));
}
// it would be nice to stay on the claim if you just want to delete it
// we need to alter autoplay to not start downloading again after you delete it
// if (abandonClaim) {
actions.push(goBack());
// }
dispatch(batchActions(...actions));
};
}
if (!shareModal) {
problemStorePayload = {
...problemStorePayload,
editLink: `${FRONTEND_URL}/app/problem/edit/${solution.editCode}`,
shareLink: `${FRONTEND_URL}/app/problem/view/${shareCode}`,
editorPosition: finalEditorPosition,
textAreaValue: '',
};
}
yield put(updateProblemStore(problemStorePayload));
alertSuccess(Locales.strings.problem_saved_success_message,
Locales.strings.success);
if (redirectBack) {
yield put(goBack());
}
if (!matchedRoute && shareCode) {
if (shareModal) {
yield put(updateProblemStore({
shareLink: `${FRONTEND_URL}/app/problem/view/${shareCode}`,
}));
yield put(toggleModals([SHARE_SET]));
}
}
} catch (error) {
// dispatch a failure action to the store with the error
yield put({
type: 'REQUEST_COMMIT_PROBLEM_SOLUTION_FAILURE',
payload: {
error,
},
});
if (action === 'view') {
yield put(shareSolutionsAction(action, code, true));
} else if (action === 'edit') {
// renderShareToClassroom(
// 'shareInClassroom',
// `/#/app/problemSet/view/${shareCode}`, {
// title,
// },
// );
if (position && orderedProblems.length > 0) {
const selectedProblem = orderedProblems.find(
problem => String(problem.position) === position,
);
if (!selectedProblem) {
yield put(goBack());
yield put({
type: 'REQUEST_PROBLEM_SET_FAILURE',
});
alertError('Unable to edit problem');
}
let steps = [{
explanation: selectedProblem.title,
stepValue: selectedProblem.text,
deleted: false,
cleanup: null,
scratchpad: null,
}];
if (selectedProblem.steps.length > 0) {
steps = selectedProblem.steps;
}
yield put({
yield takeLatest('REDIRECT_AFTER_LOGIN', function* workerSaga({
payload: {
forceBack,
},
}) {
const {
redirectTo,
} = yield select(getState);
if (redirectTo === 'back') {
yield put(goBack());
} else if (forceBack || redirectTo === 'app' || ['#/signin', '#/userdetails'].includes(window.location.hash.toLowerCase())) {
yield put(replace('/app'));
}
yield put(setAuthRedirect(null));
});
}
goBack: !ownProps.isStandalone ? () => dispatch(goBack()) : undefined,
})
onClose: () => dispatch(goBack()),
})
(dispatch) => {
dispatch(goBack());
}
);
back: () => dispatch(goBack()),
}
back: () => dispatch(goBack()),
onPipetteSelect: spec => spec && ownProps.setWantedName(spec.name),
export const routerGoBack = () => dispatch => {
dispatch(goBack());
};