Pretty-ify code. Remove unnecessary comment
This commit is contained in:
parent
8cce580008
commit
4884a49dfb
|
@ -411,7 +411,7 @@ section > footer > div > form > button.liked {
|
|||
}
|
||||
|
||||
section > footer > div > form > button.like > span.liked-by {
|
||||
display: none
|
||||
display: none;
|
||||
}
|
||||
|
||||
section > footer > div > form > button.like:hover {
|
||||
|
|
|
@ -469,7 +469,9 @@ module.exports = ({ cooler, isPublic }) => {
|
|||
.map(([key]) => key);
|
||||
|
||||
// get an array of voter names, for display on hover
|
||||
const pendingVoterNames = voters.map((author) => models.about.name(author));
|
||||
const pendingVoterNames = voters.map((author) =>
|
||||
models.about.name(author)
|
||||
);
|
||||
const voterNames = await Promise.all(pendingVoterNames);
|
||||
|
||||
const pendingName = models.about.name(msg.value.author);
|
||||
|
@ -1056,13 +1058,12 @@ module.exports = ({ cooler, isPublic }) => {
|
|||
|
||||
const adjustedObj = Object.entries(obj).reduce(
|
||||
(acc, [author, values]) => {
|
||||
// If the author liked their own content, ignore the vote
|
||||
if (author === myFeedId) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
// The value of a users vote is 1 / (1 + total votes), the
|
||||
// more a user votes, the less weight is given to each vote.
|
||||
// The value of a users vote is 1 / (1 + total votes), the
|
||||
// more a user votes, the less weight is given to each vote.
|
||||
|
||||
const entries = Object.entries(values);
|
||||
const total = 1 + Math.log(entries.length);
|
||||
|
|
|
@ -474,7 +474,7 @@ const post = ({ msg, aside = false }) => {
|
|||
|
||||
const maxLikedNameLength = 16;
|
||||
const maxLikedNames = 20;
|
||||
|
||||
|
||||
const likedBy = msg.value.meta.votes
|
||||
.slice(0, maxLikedNames)
|
||||
.map((name) => name.slice(0, maxLikedNameLength))
|
||||
|
@ -571,11 +571,13 @@ const post = ({ msg, aside = false }) => {
|
|||
class: likeButton.class,
|
||||
},
|
||||
`❤ ${likeCount}`,
|
||||
span({
|
||||
class: "liked-by",
|
||||
},
|
||||
`Liked by ${likedBy}`)
|
||||
),
|
||||
span(
|
||||
{
|
||||
class: "liked-by",
|
||||
},
|
||||
`Liked by ${likedBy}`
|
||||
)
|
||||
)
|
||||
),
|
||||
a({ href: url.comment }, i18n.comment),
|
||||
isPrivate || isRoot || isFork
|
||||
|
|
Loading…
Reference in New Issue