mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-20 22:52:46 -05:00
fix: add not found if package is missing
This commit is contained in:
parent
86dd30313e
commit
4da21c1490
1 changed files with 6 additions and 3 deletions
|
@ -10,6 +10,7 @@ import DetailContainer from '../../components/DetailContainer';
|
||||||
import DetailSidebar from '../../components/DetailSidebar';
|
import DetailSidebar from '../../components/DetailSidebar';
|
||||||
import { callDetailPage } from '../../utils/calls';
|
import { callDetailPage } from '../../utils/calls';
|
||||||
import { getRouterPackageName } from '../../utils/package';
|
import { getRouterPackageName } from '../../utils/package';
|
||||||
|
import NotFound from '../../components/NotFound';
|
||||||
|
|
||||||
export const DetailContext = React.createContext();
|
export const DetailContext = React.createContext();
|
||||||
|
|
||||||
|
@ -105,7 +106,11 @@ class VersionPage extends Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
const { isLoading, packageMeta, readMe, packageName } = this.state;
|
const { isLoading, packageMeta, readMe, packageName } = this.state;
|
||||||
|
|
||||||
if (isLoading === false) {
|
if (isLoading) {
|
||||||
|
return <Loading />;
|
||||||
|
} else if (!packageMeta) {
|
||||||
|
return <NotFound />;
|
||||||
|
} else {
|
||||||
return (
|
return (
|
||||||
<DetailContextProvider value={{ packageMeta, readMe, packageName, enableLoading: this.enableLoading }}>
|
<DetailContextProvider value={{ packageMeta, readMe, packageName, enableLoading: this.enableLoading }}>
|
||||||
<Grid className={'container content'} container={true} spacing={0}>
|
<Grid className={'container content'} container={true} spacing={0}>
|
||||||
|
@ -118,8 +123,6 @@ class VersionPage extends Component<any, any> {
|
||||||
</Grid>
|
</Grid>
|
||||||
</DetailContextProvider>
|
</DetailContextProvider>
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
return <Loading />;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue