diff --git a/src/Flows.css b/src/Flows.css index 2d4a88a..c289c10 100644 --- a/src/Flows.css +++ b/src/Flows.css @@ -277,4 +277,10 @@ @keyframes slide-in-from-top { 0% {opacity: 0; transform: translateY(-50%);} 100% {opacity: 1;} +} + +.reply-header-badge { + float: right; + padding: 0 .5em; + opacity: .4; } \ No newline at end of file diff --git a/src/Flows.js b/src/Flows.js index a4cf4d4..b2f2fcf 100644 --- a/src/Flows.js +++ b/src/Flows.js @@ -12,9 +12,6 @@ import {API, PKUHELPER_ROOT} from './flows_api'; const IMAGE_BASE=PKUHELPER_ROOT+'services/pkuhole/images/'; const AUDIO_BASE=PKUHELPER_ROOT+'services/pkuhole/audios/'; -// troubleshotting performance problem with http2 -//const IMAGE_BASE='http://pkuhelper.pku.edu.cn/services/pkuhole/images/'; -//const AUDIO_BASE='http://pkuhelper.pku.edu.cn/services/pkuhole/audios/'; const SEARCH_PAGESIZE=50; const CLICKABLE_TAGS={a: true, audio: true}; @@ -85,11 +82,11 @@ class Reply extends PureComponent { '--box-bgcolor-dark': this.props.info._display_color[1], } : null}>
- {this.props.do_filter_name ? - {this.props.do_filter_name(this.props.info.name);}}> - #{this.props.info.cid} - : - #{this.props.info.cid} + #{this.props.info.cid} + {!!this.props.do_filter_name && + {this.props.do_filter_name(this.props.info.name);}}> + + }   {this.props.info.tag!==null && @@ -338,6 +335,13 @@ class FlowSidebar extends PureComponent { // key for lazyload elem let view_mode_key=(this.state.rev ? 'y-' : 'n-')+(this.state.filter_name||'null'); + let replies_cnt={}; + replies_to_show.forEach((r)=>{ + if(replies_cnt[r.name]===undefined) + replies_cnt[r.name]=0; + replies_cnt[r.name]++; + }); + return (
@@ -402,7 +406,7 @@ class FlowSidebar extends PureComponent { {this.set_variant(reply.cid,variant);}} - do_filter_name={this.set_filter_name.bind(this)} + do_filter_name={replies_cnt[reply.name]>1 ? this.set_filter_name.bind(this) : null} />