mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
BIG-117: fix dashboard redirect all routes to homepage once refresh the page.
This commit is contained in:
@@ -6,7 +6,6 @@ import { compose } from 'utils';
|
||||
import withAuthentication from 'containers/Authentication/withAuthentication';
|
||||
import withOrganization from 'containers/Organization/withOrganization';
|
||||
|
||||
|
||||
function EnsureOrganizationIsReady({
|
||||
// #ownProps
|
||||
children,
|
||||
@@ -15,10 +14,10 @@ function EnsureOrganizationIsReady({
|
||||
// #withOrganizationByOrgId
|
||||
isOrganizationReady,
|
||||
}) {
|
||||
return (isOrganizationReady) ? children : (
|
||||
<Redirect
|
||||
to={{ pathname: redirectTo }}
|
||||
/>
|
||||
return isOrganizationReady ? (
|
||||
children
|
||||
) : (
|
||||
<Redirect to={{ pathname: redirectTo }} />
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,4 +27,4 @@ export default compose(
|
||||
organizationId: props.currentOrganizationId,
|
||||
})),
|
||||
withOrganization(({ isOrganizationReady }) => ({ isOrganizationReady })),
|
||||
)(EnsureOrganizationIsReady);
|
||||
)(EnsureOrganizationIsReady);
|
||||
|
||||
Reference in New Issue
Block a user