Skip to content

Commit

Permalink
fix: add not found if package is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
juanpicado committed Mar 24, 2019
1 parent 86dd303 commit 4da21c1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/webui/pages/version/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import DetailContainer from '../../components/DetailContainer';
import DetailSidebar from '../../components/DetailSidebar';
import { callDetailPage } from '../../utils/calls';
import { getRouterPackageName } from '../../utils/package';
import NotFound from '../../components/NotFound';

export const DetailContext = React.createContext();

Expand Down Expand Up @@ -105,7 +106,11 @@ class VersionPage extends Component<any, any> {
render() {
const { isLoading, packageMeta, readMe, packageName } = this.state;

if (isLoading === false) {
if (isLoading) {
return <Loading />;
} else if (!packageMeta) {
return <NotFound />;
} else {
return (
<DetailContextProvider value={{ packageMeta, readMe, packageName, enableLoading: this.enableLoading }}>
<Grid className={'container content'} container={true} spacing={0}>
Expand All @@ -118,8 +123,6 @@ class VersionPage extends Component<any, any> {
</Grid>
</DetailContextProvider>
);
} else {
return <Loading />;
}
}

Expand Down

0 comments on commit 4da21c1

Please sign in to comment.