How to use the connected-react-router.goBack function in connected-react-router

To help you get started, we’ve selected a few connected-react-router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lbryio / lbry-desktop / src / ui / redux / actions / file.js View on Github external
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));
  };
}
github benetech / MathShare / src / redux / problem / sagas.js View on Github external
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,
                },
github benetech / MathShare / src / redux / problemList / sagas.js View on Github external
});
                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({
github benetech / MathShare / src / redux / userProfile / sagas.js View on Github external
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));
    });
}
github Opentrons / opentrons / app / src / components / ChangePipette / index.js View on Github external
    back: () => dispatch(goBack()),
    onPipetteSelect: spec => spec && ownProps.setWantedName(spec.name),
github alcedo-ui / alcedo-ui / examples / reduxes / actions / common / RouterAction.js View on Github external
export const routerGoBack = () => dispatch => {
    dispatch(goBack());
};