link fe: use correct time attribute

This commit is contained in:
Fang 2020-02-06 15:32:14 +01:00
parent 182d2c3a07
commit 50695fe78a
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
2 changed files with 6 additions and 6 deletions

View File

@ -36,7 +36,7 @@ export class LinkDetail extends Component {
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if (this.props.data.timestamp !== prevProps.data.timestamp) { if (this.props.data.time !== prevProps.data.time) {
this.setState({timeSinceLinkPost: this.getTimeSinceLinkPost()}) this.setState({timeSinceLinkPost: this.getTimeSinceLinkPost()})
} }
@ -53,8 +53,8 @@ export class LinkDetail extends Component {
} }
getTimeSinceLinkPost() { getTimeSinceLinkPost() {
return !!this.props.data.timestamp ? return !!this.props.data.time ?
moment.unix(this.props.data.timestamp / 1000).from(moment.utc()) moment.unix(this.props.data.time / 1000).from(moment.utc())
: ''; : '';
} }

View File

@ -44,7 +44,7 @@ export class Links extends Component {
let LinkList = Object.keys(links) let LinkList = Object.keys(links)
.map((link) => { .map((link) => {
let linksObj = props.links[linkPage]; let linksObj = props.links[linkPage];
let { title, url, timestamp, ship } = linksObj[link]; let { title, url, time, ship } = linksObj[link];
let members = {}; let members = {};
const commentCount = props.comments[url] const commentCount = props.comments[url]
@ -71,12 +71,12 @@ export class Links extends Component {
return ( return (
<LinkItem <LinkItem
key={timestamp} key={time}
title={title} title={title}
page={props.page} page={props.page}
index={link} index={link}
url={url} url={url}
timestamp={timestamp} timestamp={time}
nickname={nickname} nickname={nickname}
ship={ship} ship={ship}
color={color} color={color}