From ed582ebde5a3e8355d843ca796972dfb96de1c23 Mon Sep 17 00:00:00 2001 From: hole-thu Date: Fri, 5 May 2023 22:19:50 +0800 Subject: [PATCH] reverse replies for reply timeline --- src/Flows.js | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/Flows.js b/src/Flows.js index ab7b601..5004f48 100644 --- a/src/Flows.js +++ b/src/Flows.js @@ -1083,7 +1083,8 @@ class FlowItemRow extends PureComponent { } render() { - const { show_sidebar, token, search_param, is_quote, mode } = this.props; + const { show_sidebar, token, search_param, is_quote, mode, submode } = + this.props; let show_pid = load_single_meta(show_sidebar, token, [this.state.info.pid]); let hl_rules = [['pid', PID_RE]]; @@ -1108,6 +1109,11 @@ class FlowItemRow extends PureComponent { } } + let replies_to_show = this.state.replies.slice(0, PREVIEW_REPLY_COUNT); + if (mode === 'list' && submode === 1) { + replies_to_show.reverse(); + } + let res = (
{this.state.reply_error}

)} - {this.state.replies - .slice(0, PREVIEW_REPLY_COUNT) - .map( - (reply) => - (reply.can_del || !reply.is_blocked) && ( - - ), - )} + {replies_to_show.map( + (reply) => + (reply.can_del || !reply.is_blocked) && ( + + ), + )} {this.state.replies.length > PREVIEW_REPLY_COUNT && (
还有 {this.state.replies.length - PREVIEW_REPLY_COUNT} 条 @@ -1367,6 +1371,7 @@ function FlowChunk(props) {