Change thread indentation to be more consistent

This commit is contained in:
Christian Bundy 2019-09-27 11:40:00 -07:00
parent 819986c35b
commit fe5791e98c
No known key found for this signature in database
GPG Key ID: EB541AAEF4366237
2 changed files with 8 additions and 2 deletions

View File

@ -377,10 +377,11 @@ const post = {
return Promise.all(replies.map(async (reply) => {
const deeperReplies = await oneDeeper(reply.key, depth + 1)
lodash.set(reply, 'value.meta.thread.depth', depth)
lodash.set(reply, 'value.meta.thread.reply', true)
return [reply, deeperReplies]
}))
}
oneDeeper(key, 1).then((nested) => {
oneDeeper(key, 0).then((nested) => {
const nestedReplies = [...nested]
const deepReplies = flattenDeep(nestedReplies)
resolve(deepReplies)

View File

@ -44,6 +44,11 @@ module.exports = ({ msg }) => {
'value.meta.thread.target',
false
))
const isReply = Boolean(lodash.get(
msg,
'value.meta.thread.reply',
false
))
const { name } = msg.value.meta.author
const timeAgo = msg.value.meta.timestamp.received.since
@ -74,7 +79,7 @@ module.exports = ({ msg }) => {
messageClasses.push('thread-target')
}
if (depth > 0) {
if (isReply) {
messageClasses.push('reply')
}