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 <Route
key="not-found" key="not-found"
path="*" path="*"
render={() => ( render={() =>
<ContentError isNotFound> !hasContentLoading && (
<Link <ContentError isNotFound>
to={`/jobs/${match.params.type}/${match.params.id}/details`} <Link
> to={`/jobs/${match.params.type}/${match.params.id}/details`}
{i18n._(`View Job Details`)} >
</Link> {i18n._(`View Job Details`)}
</ContentError> </Link>
)} </ContentError>
)
}
/>, />,
]} ]}
</Switch> </Switch>

View File

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

View File

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