Refactor shouldUpdateScroll stuff

This commit is contained in:
Claire
2021-07-13 12:40:15 +02:00
parent 99f28c17de
commit 84fbe4d030
8 changed files with 27 additions and 29 deletions

View File

@ -32,7 +32,7 @@ import { initBlockModal } from 'flavours/glitch/actions/blocks';
import { initReport } from 'flavours/glitch/actions/reports';
import { initBoostModal } from 'flavours/glitch/actions/boosts';
import { makeGetStatus } from 'flavours/glitch/selectors';
import { ScrollContainer } from 'react-router-scroll-4';
import ScrollContainer from 'flavours/glitch/containers/scroll_container';
import ColumnBackButton from 'flavours/glitch/components/column_back_button';
import ColumnHeader from '../../components/column_header';
import StatusContainer from 'flavours/glitch/containers/status_container';
@ -507,10 +507,6 @@ class Status extends ImmutablePureComponent {
this.setState({ fullscreen: isFullscreen() });
}
shouldUpdateScroll = (prevRouterProps, { location }) => {
return !(prevRouterProps?.location?.state?.mastodonModalKey || location.state?.mastodonModalKey);
}
render () {
let ancestors, descendants;
const { setExpansion } = this;
@ -561,7 +557,7 @@ class Status extends ImmutablePureComponent {
)}
/>
<ScrollContainer scrollKey='thread' shouldUpdateScroll={this.shouldUpdateScroll}>
<ScrollContainer scrollKey='thread'>
<div className={classNames('scrollable', 'detailed-status__wrapper', { fullscreen })} ref={this.setRef}>
{ancestors}