mirror of
https://github.com/flarum/core.git
synced 2025-08-07 17:07:19 +02:00
Simplify paused logic
This commit is contained in:
committed by
Franz Liedke
parent
5427b35c6d
commit
9c63c54868
@@ -23,9 +23,6 @@ export default class PostStream extends Component {
|
|||||||
this.loadPageTimeouts = {};
|
this.loadPageTimeouts = {};
|
||||||
this.pagesLoading = 0;
|
this.pagesLoading = 0;
|
||||||
|
|
||||||
this.state.on('unpaused', () => {
|
|
||||||
this.scrollListener.update();
|
|
||||||
});
|
|
||||||
this.state.on('scrollToLast', () => {
|
this.state.on('scrollToLast', () => {
|
||||||
this.scrollToLast();
|
this.scrollToLast();
|
||||||
});
|
});
|
||||||
|
@@ -75,7 +75,7 @@ class PostStreamState {
|
|||||||
this.trigger('scrollToNumber', number, noAnimation);
|
this.trigger('scrollToNumber', number, noAnimation);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.unpause();
|
this.paused = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ class PostStreamState {
|
|||||||
this.trigger('scrollToIndex', index, noAnimation, backwards);
|
this.trigger('scrollToIndex', index, noAnimation, backwards);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.unpause();
|
this.paused = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ class PostStreamState {
|
|||||||
const anchorIndex = backwards ? this.visibleEnd - 1 : this.visibleStart;
|
const anchorIndex = backwards ? this.visibleEnd - 1 : this.visibleStart;
|
||||||
anchorScroll(`.PostStream-item[data-index="${anchorIndex}"]`, () => m.redraw(true));
|
anchorScroll(`.PostStream-item[data-index="${anchorIndex}"]`, () => m.redraw(true));
|
||||||
|
|
||||||
this.unpause();
|
this.paused = false;
|
||||||
};
|
};
|
||||||
redraw();
|
redraw();
|
||||||
|
|
||||||
@@ -368,7 +368,6 @@ class PostStreamState {
|
|||||||
*/
|
*/
|
||||||
unpause() {
|
unpause() {
|
||||||
this.paused = false;
|
this.paused = false;
|
||||||
this.trigger('unpaused');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user