TimelineQueueButtonHeader: always scroll to top

merge-requests/692/head^2
Alex Gleason 2021-10-08 14:51:54 -05:00
rodzic 4840a3c751
commit 38b41ced76
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -82,7 +82,6 @@ export default class StatusList extends ImmutablePureComponent {
}
handleDequeueTimeline = () => {
window.scrollTo({ top: 0, behavior: 'smooth' });
const { onDequeueTimeline, timelineId } = this.props;
if (!onDequeueTimeline || !timelineId) return;
onDequeueTimeline(timelineId);

Wyświetl plik

@ -55,8 +55,13 @@ class TimelineQueueButtonHeader extends React.PureComponent {
}
}, 150, { trailing: true });
handleClick = e => {
window.scrollTo({ top: 0, behavior: 'smooth' });
this.props.onClick(e);
}
render() {
const { count, message, onClick, intl } = this.props;
const { count, message, intl } = this.props;
const { scrolled } = this.state;
const visible = count > 0 && scrolled;
@ -67,7 +72,7 @@ class TimelineQueueButtonHeader extends React.PureComponent {
return (
<div className={classes}>
<a className='timeline-queue-header__btn' onClick={onClick}>
<a className='timeline-queue-header__btn' onClick={this.handleClick}>
<Icon src={require('@tabler/icons/icons/arrow-bar-to-up.svg')} />
{(count > 0) && (
<div className='timeline-queue-header__label'>