link fe: fully account for the "number as string" case

The Number() usage is sane, but should be scoped around the variable by
itself. Previously a string of "3" would lead to a Number("31") call,
which is not the intended behavior here.

Also stops passing a {} in if the actual number is unknown.
This commit is contained in:
Fang 2020-02-06 16:54:12 +01:00
parent e74ec92c4c
commit 9b9692e7f1
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ export class CommentsPagination extends Component {
? "dib"
: "dn";
let nextDisplay = (Number(props.commentPage + 1) < Number(props.total))
let nextDisplay = ((Number(props.commentPage) + 1) < Number(props.total))
? "dib"
: "dn";

View File

@ -48,7 +48,7 @@ export class Comments extends Component {
let total = !!props.comments
? props.comments.totalPages
: {};
: 1;
let commentsList = Object.keys(commentsPage)
.map((entry) => {