Clean up redundant shouldUpdateScroll definitions

lolsob-rspec
Thibaut Girka 2019-07-20 16:07:55 +02:00 committed by ThibG
parent 06990c0ece
commit f447eef7cd
9 changed files with 0 additions and 46 deletions

View File

@ -41,11 +41,6 @@ export default class Blocks extends ImmutablePureComponent {
this.props.dispatch(expandBlocks()); this.props.dispatch(expandBlocks());
}, 300, { leading: true }); }, 300, { leading: true });
shouldUpdateScroll = (prevRouterProps, { location }) => {
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
return !(location.state && location.state.mastodonModalOpen);
}
render () { render () {
const { intl, accountIds, hasMore } = this.props; const { intl, accountIds, hasMore } = this.props;
@ -66,7 +61,6 @@ export default class Blocks extends ImmutablePureComponent {
scrollKey='blocks' scrollKey='blocks'
onLoadMore={this.handleLoadMore} onLoadMore={this.handleLoadMore}
hasMore={hasMore} hasMore={hasMore}
shouldUpdateScroll={this.shouldUpdateScroll}
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{accountIds.map(id => {accountIds.map(id =>

View File

@ -99,10 +99,6 @@ export default class CommunityTimeline extends React.PureComponent {
dispatch(expandCommunityTimeline({ maxId, onlyMedia })); dispatch(expandCommunityTimeline({ maxId, onlyMedia }));
} }
shouldUpdateScroll = (prevRouterProps, { location }) => {
return !(location.state && location.state.mastodonModalOpen)
}
render () { render () {
const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props; const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props;
const pinned = !!columnId; const pinned = !!columnId;
@ -125,7 +121,6 @@ export default class CommunityTimeline extends React.PureComponent {
<StatusListContainer <StatusListContainer
trackScroll={!pinned} trackScroll={!pinned}
scrollKey={`community_timeline-${columnId}`} scrollKey={`community_timeline-${columnId}`}
shouldUpdateScroll={this.shouldUpdateScroll}
timelineId={`community${onlyMedia ? ':media' : ''}`} timelineId={`community${onlyMedia ? ':media' : ''}`}
onLoadMore={this.handleLoadMore} onLoadMore={this.handleLoadMore}
emptyMessage={<FormattedMessage id='empty_column.community' defaultMessage='The local timeline is empty. Write something publicly to get the ball rolling!' />} emptyMessage={<FormattedMessage id='empty_column.community' defaultMessage='The local timeline is empty. Write something publicly to get the ball rolling!' />}

View File

@ -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 = () => { handleHeaderClick = () => {
this.column.scrollTop(); this.column.scrollTop();
} }
@ -76,7 +71,6 @@ export default class Favourites extends ImmutablePureComponent {
/> />
<ScrollableList <ScrollableList
scrollKey='favourites' scrollKey='favourites'
shouldUpdateScroll={this.shouldUpdateScroll}
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{accountIds.map(id => {accountIds.map(id =>

View File

@ -41,11 +41,6 @@ export default class FollowRequests extends ImmutablePureComponent {
this.props.dispatch(expandFollowRequests()); this.props.dispatch(expandFollowRequests());
}, 300, { leading: true }); }, 300, { leading: true });
shouldUpdateScroll = (prevRouterProps, { location }) => {
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
return !(location.state && location.state.mastodonModalOpen);
}
render () { render () {
const { intl, accountIds, hasMore } = this.props; const { intl, accountIds, hasMore } = this.props;
@ -67,7 +62,6 @@ export default class FollowRequests extends ImmutablePureComponent {
scrollKey='follow_requests' scrollKey='follow_requests'
onLoadMore={this.handleLoadMore} onLoadMore={this.handleLoadMore}
hasMore={hasMore} hasMore={hasMore}
shouldUpdateScroll={this.shouldUpdateScroll}
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{accountIds.map(id => {accountIds.map(id =>

View File

@ -64,11 +64,6 @@ export default class Followers extends ImmutablePureComponent {
this.props.dispatch(expandFollowers(this.props.params.accountId)); this.props.dispatch(expandFollowers(this.props.params.accountId));
}, 300, { leading: true }); }, 300, { leading: true });
shouldUpdateScroll = (prevRouterProps, { location }) => {
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
return !(location.state && location.state.mastodonModalOpen);
}
setRef = c => { setRef = c => {
this.column = c; this.column = c;
} }
@ -102,7 +97,6 @@ export default class Followers extends ImmutablePureComponent {
scrollKey='followers' scrollKey='followers'
hasMore={hasMore} hasMore={hasMore}
onLoadMore={this.handleLoadMore} onLoadMore={this.handleLoadMore}
shouldUpdateScroll={this.shouldUpdateScroll}
prepend={<HeaderContainer accountId={this.props.params.accountId} hideTabs />} prepend={<HeaderContainer accountId={this.props.params.accountId} hideTabs />}
alwaysPrepend alwaysPrepend
emptyMessage={emptyMessage} emptyMessage={emptyMessage}

View File

@ -97,7 +97,6 @@ export default class Following extends ImmutablePureComponent {
scrollKey='following' scrollKey='following'
hasMore={hasMore} hasMore={hasMore}
onLoadMore={this.handleLoadMore} onLoadMore={this.handleLoadMore}
shouldUpdateScroll={this.shouldUpdateScroll}
prepend={<HeaderContainer accountId={this.props.params.accountId} hideTabs />} prepend={<HeaderContainer accountId={this.props.params.accountId} hideTabs />}
alwaysPrepend alwaysPrepend
emptyMessage={emptyMessage} emptyMessage={emptyMessage}

View File

@ -41,11 +41,6 @@ export default class Mutes extends ImmutablePureComponent {
this.props.dispatch(expandMutes()); this.props.dispatch(expandMutes());
}, 300, { leading: true }); }, 300, { leading: true });
shouldUpdateScroll = (prevRouterProps, { location }) => {
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
return !(location.state && location.state.mastodonModalOpen);
}
render () { render () {
const { intl, accountIds, hasMore } = this.props; const { intl, accountIds, hasMore } = this.props;
@ -66,7 +61,6 @@ export default class Mutes extends ImmutablePureComponent {
scrollKey='mutes' scrollKey='mutes'
onLoadMore={this.handleLoadMore} onLoadMore={this.handleLoadMore}
hasMore={hasMore} hasMore={hasMore}
shouldUpdateScroll={this.shouldUpdateScroll}
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{accountIds.map(id => {accountIds.map(id =>

View File

@ -99,10 +99,6 @@ export default class PublicTimeline extends React.PureComponent {
dispatch(expandPublicTimeline({ maxId, onlyMedia })); dispatch(expandPublicTimeline({ maxId, onlyMedia }));
} }
shouldUpdateScroll = (prevRouterProps, { location }) => {
return !(location.state && location.state.mastodonModalOpen)
}
render () { render () {
const { intl, columnId, hasUnread, multiColumn, onlyMedia } = this.props; const { intl, columnId, hasUnread, multiColumn, onlyMedia } = this.props;
const pinned = !!columnId; const pinned = !!columnId;

View File

@ -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 = () => { handleHeaderClick = () => {
this.column.scrollTop(); this.column.scrollTop();
} }
@ -77,7 +72,6 @@ export default class Reblogs extends ImmutablePureComponent {
<ScrollableList <ScrollableList
scrollKey='reblogs' scrollKey='reblogs'
shouldUpdateScroll={this.shouldUpdateScroll}
emptyMessage={emptyMessage} emptyMessage={emptyMessage}
> >
{accountIds.map(id => {accountIds.map(id =>