Don't render the 404 not found page until the content's finished loading

This commit is contained in:
mabashian 2019-09-10 10:30:08 -04:00
parent eaf3a28d57
commit d4b2cacb3e
3 changed files with 35 additions and 29 deletions

View File

@ -149,15 +149,17 @@ class Job extends Component {
<Route
key="not-found"
path="*"
render={() => (
<ContentError isNotFound>
<Link
to={`/jobs/${match.params.type}/${match.params.id}/details`}
>
{i18n._(`View Job Details`)}
</Link>
</ContentError>
)}
render={() =>
!hasContentLoading && (
<ContentError isNotFound>
<Link
to={`/jobs/${match.params.type}/${match.params.id}/details`}
>
{i18n._(`View Job Details`)}
</Link>
</ContentError>
)
}
/>,
]}
</Switch>

View File

@ -238,15 +238,17 @@ class Organization extends Component {
<Route
key="not-found"
path="*"
render={() => (
<ContentError isNotFound>
{match.params.id && (
<Link to={`/organizations/${match.params.id}/details`}>
{i18n._(`View Organization Details`)}
</Link>
)}
</ContentError>
)}
render={() =>
!hasContentLoading && (
<ContentError isNotFound>
{match.params.id && (
<Link to={`/organizations/${match.params.id}/details`}>
{i18n._(`View Organization Details`)}
</Link>
)}
</ContentError>
)
}
/>
,
</Switch>

View File

@ -119,17 +119,19 @@ class Template extends Component {
<Route
key="not-found"
path="*"
render={() => (
<ContentError isNotFound>
{match.params.id && (
<Link
to={`/templates/${match.params.templateType}/${match.params.id}/details`}
>
{i18n._(`View Template Details`)}
</Link>
)}
</ContentError>
)}
render={() =>
!hasContentLoading && (
<ContentError isNotFound>
{match.params.id && (
<Link
to={`/templates/${match.params.templateType}/${match.params.id}/details`}
>
{i18n._(`View Template Details`)}
</Link>
)}
</ContentError>
)
}
/>,
]}
</Switch>