mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 01:13:14 +01:00
Bump versions of react-router & history
This commit is contained in:
parent
7a0255acd5
commit
1d5064208f
@ -39,7 +39,7 @@ export function AuthRedirect({to, when}) {
|
||||
|
||||
// and redirect if `true`.
|
||||
if(exprToValidate) {
|
||||
window.setTimeout(() => history.replace({ path: to, query }));
|
||||
window.setTimeout(() => history.replace({ pathname: to, query }));
|
||||
return true;
|
||||
|
||||
// Otherwise there can also be the case that the backend
|
||||
@ -47,7 +47,7 @@ export function AuthRedirect({to, when}) {
|
||||
} else if(!exprToValidate && when === 'loggedIn' && redirect) {
|
||||
|
||||
delete query.redirect;
|
||||
window.setTimeout(() => history.replace({ path: '/' + redirect, query: query }));
|
||||
window.setTimeout(() => history.replace({ pathname: '/' + redirect, query: query }));
|
||||
return true;
|
||||
|
||||
} else if(!exprToValidate && when === 'loggedOut' && redirectAuthenticated) {
|
||||
|
@ -17,7 +17,7 @@ export function AuthPrizeRoleRedirect({ to, when }) {
|
||||
.reduce((a, b) => a || b);
|
||||
|
||||
if (exprToValidate) {
|
||||
window.setTimeout(() => history.replace({ path: to, query: query }));
|
||||
window.setTimeout(() => history.replace({ pathname: to, query: query }));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
import { useRouterHistory } from 'react-router';
|
||||
import { useQueries } from 'history';
|
||||
import createBrowserHistory from 'history/lib/createBrowserHistory';
|
||||
|
||||
import AppConstants from './constants/application_constants';
|
||||
@ -9,4 +10,4 @@ import AppConstants from './constants/application_constants';
|
||||
// Remove the trailing slash if present
|
||||
let basename = AppConstants.baseUrl.replace(/\/$/, '');
|
||||
|
||||
export default useRouterHistory(createBrowserHistory)({ basename });
|
||||
export default useRouterHistory(useQueries(createBrowserHistory))({ basename });
|
||||
|
@ -66,7 +66,7 @@
|
||||
"gulp-uglify": "^1.2.0",
|
||||
"gulp-util": "^3.0.4",
|
||||
"harmonize": "^1.4.2",
|
||||
"history": "^1.13.1",
|
||||
"history": "^2.1.1",
|
||||
"invariant": "^2.2.0",
|
||||
"isomorphic-fetch": "^2.0.2",
|
||||
"jest-cli": "^0.4.0",
|
||||
@ -82,7 +82,7 @@
|
||||
"react-bootstrap": "^0.28.2",
|
||||
"react-datepicker": "^0.18.0",
|
||||
"react-dom": "^0.14.6",
|
||||
"react-router": "^2.0.0-rc5",
|
||||
"react-router": "^2.4.0",
|
||||
"react-router-bootstrap": "^0.20.1",
|
||||
"react-star-rating": "^1.4.2",
|
||||
"react-textarea-autosize": "^4.0.1",
|
||||
|
Loading…
Reference in New Issue
Block a user