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:
@@ -282,7 +282,7 @@ export default class DiscussionPage extends Page {
|
|||||||
items.add(
|
items.add(
|
||||||
'scrubber',
|
'scrubber',
|
||||||
PostStreamScrubber.component({
|
PostStreamScrubber.component({
|
||||||
stream: this.stream,
|
discussion: this.discussion,
|
||||||
className: 'App-titleControl',
|
className: 'App-titleControl',
|
||||||
onNavigate: this.stream.goToIndex.bind(this.stream),
|
onNavigate: this.stream.goToIndex.bind(this.stream),
|
||||||
count: this.stream.count(),
|
count: this.stream.count(),
|
||||||
|
@@ -10,7 +10,7 @@ import formatNumber from '../../common/utils/formatNumber';
|
|||||||
*
|
*
|
||||||
* ### Props
|
* ### Props
|
||||||
*
|
*
|
||||||
* - `stream`
|
* - `discussion`
|
||||||
* - `className`
|
* - `className`
|
||||||
* - `onNavigate`
|
* - `onNavigate`
|
||||||
* - `count`
|
* - `count`
|
||||||
@@ -21,7 +21,6 @@ import formatNumber from '../../common/utils/formatNumber';
|
|||||||
*/
|
*/
|
||||||
export default class PostStreamScrubber extends Component {
|
export default class PostStreamScrubber extends Component {
|
||||||
init() {
|
init() {
|
||||||
this.stream = this.props.stream;
|
|
||||||
this.handlers = {};
|
this.handlers = {};
|
||||||
|
|
||||||
// Define a handler to update the state of the scrollbar to reflect the
|
// Define a handler to update the state of the scrollbar to reflect the
|
||||||
@@ -38,7 +37,7 @@ export default class PostStreamScrubber extends Component {
|
|||||||
view() {
|
view() {
|
||||||
const retain = this.subtree.retain();
|
const retain = this.subtree.retain();
|
||||||
const { count, index, visible } = this.props;
|
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 unreadPercent = count ? Math.min(count - this.props.index, unreadCount) / count : 0;
|
||||||
|
|
||||||
const viewing = app.translator.transChoice('core.forum.post_scrubber.viewing_text', count, {
|
const viewing = app.translator.transChoice('core.forum.post_scrubber.viewing_text', count, {
|
||||||
|
Reference in New Issue
Block a user