colorList,
commentTreeMaxDepth,
futureDaysToUnixTime,
+ getCommentParentId,
isAdmin,
isBanned,
isMod,
showReportDialog: boolean;
reportReason?: string;
my_vote?: number;
- score: bigint;
- upvotes: bigint;
- downvotes: bigint;
+ score: number;
+ upvotes: number;
+ downvotes: number;
readLoading: boolean;
saveLoading: boolean;
}
)}
</button>
{this.linkBtn(true)}
+ {cv.comment.language_id != 0 && (
+ <span className="">
+ {
+ this.props.allLanguages.find(
+ lang => lang.id === cv.comment.language_id
+ )?.name
+ }
+ </span>
+ )}
{/* This is an expanding spacer for mobile */}
- <div className="mr-lg-5 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2"></div>
+ <div className="mr-lg-5 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2" />
{showScores() && (
<>
<a
>
{i18n.t("x_more_replies", {
count: node.comment_view.counts.child_count,
- formattedCount: numToSI(
- BigInt(node.comment_view.counts.child_count)
- ),
+ formattedCount: numToSI(node.comment_view.counts.child_count),
})}{" "}
➔
</button>
? i18n.t("show_context")
: i18n.t("link");
+ // The context button should show the parent comment by default
+ const parentCommentId = getCommentParentId(cv.comment) ?? cv.comment.id;
+
return (
<>
<Link
className={classnames}
- to={`/comment/${cv.comment.id}`}
+ to={`/comment/${parentCommentId}`}
title={title}
>
<Icon icon="link" classes="icon-inline" />
if (myVote == 1) {
this.setState({
- score: this.state.score - 1n,
- upvotes: this.state.upvotes - 1n,
+ score: this.state.score - 1,
+ upvotes: this.state.upvotes - 1,
});
} else if (myVote == -1) {
this.setState({
- downvotes: this.state.downvotes - 1n,
- upvotes: this.state.upvotes + 1n,
- score: this.state.score + 2n,
+ downvotes: this.state.downvotes - 1,
+ upvotes: this.state.upvotes + 1,
+ score: this.state.score + 2,
});
} else {
this.setState({
- score: this.state.score + 1n,
- upvotes: this.state.upvotes + 1n,
+ score: this.state.score + 1,
+ upvotes: this.state.upvotes + 1,
});
}
if (myVote == 1) {
this.setState({
- downvotes: this.state.downvotes + 1n,
- upvotes: this.state.upvotes - 1n,
- score: this.state.score - 2n,
+ downvotes: this.state.downvotes + 1,
+ upvotes: this.state.upvotes - 1,
+ score: this.state.score - 2,
});
} else if (myVote == -1) {
this.setState({
- downvotes: this.state.downvotes - 1n,
- score: this.state.score + 1n,
+ downvotes: this.state.downvotes - 1,
+ score: this.state.score + 1,
});
} else {
this.setState({
- downvotes: this.state.downvotes + 1n,
- score: this.state.score - 1n,
+ downvotes: this.state.downvotes + 1,
+ score: this.state.score - 1,
});
}
post_id: i.props.node.comment_view.post.id,
parent_id: i.props.node.comment_view.comment.id,
max_depth: commentTreeMaxDepth,
- limit: 999n, // TODO
+ limit: 999, // TODO
type_: "All",
saved_only: false,
auth: myAuth(false),