1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 16:36:47 +02:00

Stop injecting post stream state into scrubber

This commit is contained in:
Franz Liedke
2020-08-02 07:56:58 +02:00
parent 527d93120a
commit 1fc76acf06
2 changed files with 3 additions and 4 deletions

View File

@@ -282,7 +282,7 @@ export default class DiscussionPage extends Page {
items.add(
'scrubber',
PostStreamScrubber.component({
stream: this.stream,
discussion: this.discussion,
className: 'App-titleControl',
onNavigate: this.stream.goToIndex.bind(this.stream),
count: this.stream.count(),

View File

@@ -10,7 +10,7 @@ import formatNumber from '../../common/utils/formatNumber';
*
* ### Props
*
* - `stream`
* - `discussion`
* - `className`
* - `onNavigate`
* - `count`
@@ -21,7 +21,6 @@ import formatNumber from '../../common/utils/formatNumber';
*/
export default class PostStreamScrubber extends Component {
init() {
this.stream = this.props.stream;
this.handlers = {};
// Define a handler to update the state of the scrollbar to reflect the
@@ -38,7 +37,7 @@ export default class PostStreamScrubber extends Component {
view() {
const retain = this.subtree.retain();
const { count, index, visible } = this.props;
const unreadCount = this.stream.discussion.unreadCount();
const unreadCount = this.props.discussion.unreadCount();
const unreadPercent = count ? Math.min(count - this.props.index, unreadCount) / count : 0;
const viewing = app.translator.transChoice('core.forum.post_scrubber.viewing_text', count, {