mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
fix: 🐛 local package last sync time shown as year 1970
This commit is contained in:
parent
2a69f4e51a
commit
aa49098d39
1 changed files with 3 additions and 3 deletions
|
@ -23,12 +23,12 @@ export default class PackageSidebar extends React.Component {
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
await this.loadPackageData(this.props.packageName)
|
||||
await this.loadPackageData(this.props.packageName);
|
||||
}
|
||||
|
||||
async componentWillReceiveProps(newProps) {
|
||||
if (newProps.packageName !== this.props.packageName) {
|
||||
await this.loadPackageData(newProps.packageName)
|
||||
await this.loadPackageData(newProps.packageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ export default class PackageSidebar extends React.Component {
|
|||
recentReleases = recentReleases.slice(recentReleases.length - 3, recentReleases.length).reverse();
|
||||
|
||||
this.setState({
|
||||
lastUpdate: (new Date(lastUpdate)).toLocaleString(),
|
||||
lastUpdate: lastUpdate ? (new Date(lastUpdate)).toLocaleString() : '',
|
||||
recentReleases,
|
||||
author: packageMeta.latest.author,
|
||||
contributors: packageMeta.latest.contributors,
|
||||
|
|
Loading…
Reference in a new issue