mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 05:22:27 +03:00
link fe: use correct time attribute
This commit is contained in:
parent
182d2c3a07
commit
50695fe78a
@ -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())
|
||||||
: '';
|
: '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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}
|
||||||
|
Loading…
Reference in New Issue
Block a user