From: Dessalines Date: Sun, 8 Mar 2020 18:29:17 +0000 (-0400) Subject: Show ago for user details. Fixes #586 X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/static/%24%7Bargs.thread.url%7D?a=commitdiff_plain;h=cf516fcc83e1214f5822680656832485abd01aff;p=lemmy.git Show ago for user details. Fixes #586 --- diff --git a/ui/src/components/moment-time.tsx b/ui/src/components/moment-time.tsx index 24ab2d89..e3fa0de3 100644 --- a/ui/src/components/moment-time.tsx +++ b/ui/src/components/moment-time.tsx @@ -9,6 +9,7 @@ interface MomentTimeProps { when_?: string; updated?: string; }; + showAgo?: boolean; } export class MomentTime extends Component { @@ -32,7 +33,7 @@ export class MomentTime extends Component { - {moment.utc(this.props.data.updated).fromNow(true)} + {moment.utc(this.props.data.updated).fromNow(!this.props.showAgo)} ); } else { @@ -42,7 +43,7 @@ export class MomentTime extends Component { className="pointer unselectable" data-tippy-content={this.format(str)} > - {moment.utc(str).fromNow(true)} + {moment.utc(str).fromNow(!this.props.showAgo)} ); } diff --git a/ui/src/components/user.tsx b/ui/src/components/user.tsx index e97d7b08..48285113 100644 --- a/ui/src/components/user.tsx +++ b/ui/src/components/user.tsx @@ -37,6 +37,7 @@ import { createCommentLikeRes, createPostLikeFindRes, commentsToFlatNodes, + setupTippy, } from '../utils'; import { PostListing } from './post-listing'; import { SortSelect } from './sort-select'; @@ -358,7 +359,7 @@ export class User extends Component {
- {i18n.t('joined')} + {i18n.t('joined')}
@@ -1034,6 +1035,7 @@ export class User extends Component { document.title = `/u/${this.state.user.name} - ${WebSocketService.Instance.site.name}`; window.scrollTo(0, 0); this.setState(this.state); + setupTippy(); } else if (res.op == UserOperation.EditComment) { let data = res.data as CommentResponse; editCommentRes(data, this.state.comments);