Clean up redundant shouldUpdateScroll definitions
parent
06990c0ece
commit
f447eef7cd
|
@ -41,11 +41,6 @@ export default class Blocks extends ImmutablePureComponent {
|
|||
this.props.dispatch(expandBlocks());
|
||||
}, 300, { leading: true });
|
||||
|
||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||
return !(location.state && location.state.mastodonModalOpen);
|
||||
}
|
||||
|
||||
render () {
|
||||
const { intl, accountIds, hasMore } = this.props;
|
||||
|
||||
|
@ -66,7 +61,6 @@ export default class Blocks extends ImmutablePureComponent {
|
|||
scrollKey='blocks'
|
||||
onLoadMore={this.handleLoadMore}
|
||||
hasMore={hasMore}
|
||||
shouldUpdateScroll={this.shouldUpdateScroll}
|
||||
emptyMessage={emptyMessage}
|
||||
>
|
||||
{accountIds.map(id =>
|
||||
|
|
|
@ -99,10 +99,6 @@ export default class CommunityTimeline extends React.PureComponent {
|
|||
dispatch(expandCommunityTimeline({ maxId, onlyMedia }));
|
||||
}
|
||||
|
||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||
return !(location.state && location.state.mastodonModalOpen)
|
||||
}
|
||||
|
||||
render () {
|
||||
const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props;
|
||||
const pinned = !!columnId;
|
||||
|
@ -125,7 +121,6 @@ export default class CommunityTimeline extends React.PureComponent {
|
|||
<StatusListContainer
|
||||
trackScroll={!pinned}
|
||||
scrollKey={`community_timeline-${columnId}`}
|
||||
shouldUpdateScroll={this.shouldUpdateScroll}
|
||||
timelineId={`community${onlyMedia ? ':media' : ''}`}
|
||||
onLoadMore={this.handleLoadMore}
|
||||
emptyMessage={<FormattedMessage id='empty_column.community' defaultMessage='The local timeline is empty. Write something publicly to get the ball rolling!' />}
|
||||
|
|
|
@ -40,11 +40,6 @@ export default class Favourites extends ImmutablePureComponent {
|
|||
}
|
||||
}
|
||||
|
||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||
return !(location.state && location.state.mastodonModalOpen);
|
||||
}
|
||||
|
||||
handleHeaderClick = () => {
|
||||
this.column.scrollTop();
|
||||
}
|
||||
|
@ -76,7 +71,6 @@ export default class Favourites extends ImmutablePureComponent {
|
|||
/>
|
||||
<ScrollableList
|
||||
scrollKey='favourites'
|
||||
shouldUpdateScroll={this.shouldUpdateScroll}
|
||||
emptyMessage={emptyMessage}
|
||||
>
|
||||
{accountIds.map(id =>
|
||||
|
|
|
@ -41,11 +41,6 @@ export default class FollowRequests extends ImmutablePureComponent {
|
|||
this.props.dispatch(expandFollowRequests());
|
||||
}, 300, { leading: true });
|
||||
|
||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||
return !(location.state && location.state.mastodonModalOpen);
|
||||
}
|
||||
|
||||
render () {
|
||||
const { intl, accountIds, hasMore } = this.props;
|
||||
|
||||
|
@ -67,7 +62,6 @@ export default class FollowRequests extends ImmutablePureComponent {
|
|||
scrollKey='follow_requests'
|
||||
onLoadMore={this.handleLoadMore}
|
||||
hasMore={hasMore}
|
||||
shouldUpdateScroll={this.shouldUpdateScroll}
|
||||
emptyMessage={emptyMessage}
|
||||
>
|
||||
{accountIds.map(id =>
|
||||
|
|
|
@ -64,11 +64,6 @@ export default class Followers extends ImmutablePureComponent {
|
|||
this.props.dispatch(expandFollowers(this.props.params.accountId));
|
||||
}, 300, { leading: true });
|
||||
|
||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||
return !(location.state && location.state.mastodonModalOpen);
|
||||
}
|
||||
|
||||
setRef = c => {
|
||||
this.column = c;
|
||||
}
|
||||
|
@ -102,7 +97,6 @@ export default class Followers extends ImmutablePureComponent {
|
|||
scrollKey='followers'
|
||||
hasMore={hasMore}
|
||||
onLoadMore={this.handleLoadMore}
|
||||
shouldUpdateScroll={this.shouldUpdateScroll}
|
||||
prepend={<HeaderContainer accountId={this.props.params.accountId} hideTabs />}
|
||||
alwaysPrepend
|
||||
emptyMessage={emptyMessage}
|
||||
|
|
|
@ -97,7 +97,6 @@ export default class Following extends ImmutablePureComponent {
|
|||
scrollKey='following'
|
||||
hasMore={hasMore}
|
||||
onLoadMore={this.handleLoadMore}
|
||||
shouldUpdateScroll={this.shouldUpdateScroll}
|
||||
prepend={<HeaderContainer accountId={this.props.params.accountId} hideTabs />}
|
||||
alwaysPrepend
|
||||
emptyMessage={emptyMessage}
|
||||
|
|
|
@ -41,11 +41,6 @@ export default class Mutes extends ImmutablePureComponent {
|
|||
this.props.dispatch(expandMutes());
|
||||
}, 300, { leading: true });
|
||||
|
||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||
return !(location.state && location.state.mastodonModalOpen);
|
||||
}
|
||||
|
||||
render () {
|
||||
const { intl, accountIds, hasMore } = this.props;
|
||||
|
||||
|
@ -66,7 +61,6 @@ export default class Mutes extends ImmutablePureComponent {
|
|||
scrollKey='mutes'
|
||||
onLoadMore={this.handleLoadMore}
|
||||
hasMore={hasMore}
|
||||
shouldUpdateScroll={this.shouldUpdateScroll}
|
||||
emptyMessage={emptyMessage}
|
||||
>
|
||||
{accountIds.map(id =>
|
||||
|
|
|
@ -99,10 +99,6 @@ export default class PublicTimeline extends React.PureComponent {
|
|||
dispatch(expandPublicTimeline({ maxId, onlyMedia }));
|
||||
}
|
||||
|
||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||
return !(location.state && location.state.mastodonModalOpen)
|
||||
}
|
||||
|
||||
render () {
|
||||
const { intl, columnId, hasUnread, multiColumn, onlyMedia } = this.props;
|
||||
const pinned = !!columnId;
|
||||
|
|
|
@ -40,11 +40,6 @@ export default class Reblogs extends ImmutablePureComponent {
|
|||
}
|
||||
}
|
||||
|
||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||
return !(location.state && location.state.mastodonModalOpen);
|
||||
}
|
||||
|
||||
handleHeaderClick = () => {
|
||||
this.column.scrollTop();
|
||||
}
|
||||
|
@ -77,7 +72,6 @@ export default class Reblogs extends ImmutablePureComponent {
|
|||
|
||||
<ScrollableList
|
||||
scrollKey='reblogs'
|
||||
shouldUpdateScroll={this.shouldUpdateScroll}
|
||||
emptyMessage={emptyMessage}
|
||||
>
|
||||
{accountIds.map(id =>
|
||||
|
|
Loading…
Reference in New Issue