From 22d75990b775006d65350f1e71b1cf51c620f4d9 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 8 Mar 2020 14:29:17 -0400 Subject: [PATCH] Show ago for user details. Fixes #586 --- ui/src/components/moment-time.tsx | 5 +++-- ui/src/components/user.tsx | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/src/components/moment-time.tsx b/ui/src/components/moment-time.tsx index 24ab2d897..e3fa0de31 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 e97d7b08d..482851133 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);