]> cat aescling's git repositories - mastodon.git/commitdiff
Clean up redundant shouldUpdateScroll definitions
authorThibaut Girka <thib@sitedethib.com>
Sat, 20 Jul 2019 14:07:55 +0000 (16:07 +0200)
committerThibG <thib@sitedethib.com>
Sun, 21 Jul 2019 18:57:42 +0000 (20:57 +0200)
app/javascript/flavours/glitch/features/blocks/index.js
app/javascript/flavours/glitch/features/community_timeline/index.js
app/javascript/flavours/glitch/features/favourites/index.js
app/javascript/flavours/glitch/features/follow_requests/index.js
app/javascript/flavours/glitch/features/followers/index.js
app/javascript/flavours/glitch/features/following/index.js
app/javascript/flavours/glitch/features/mutes/index.js
app/javascript/flavours/glitch/features/public_timeline/index.js
app/javascript/flavours/glitch/features/reblogs/index.js

index 1a7206f802e3b0fd36a5d4b0fbfa351507c3a8a6..2d0f10ae7b5edd9505c22e323f9c790067007c38 100644 (file)
@@ -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 =>
index 2c0fbff36ac347952842e9e7e6fba76289894942..24126e5bcfb6e926d775e6b59dac8d1ce7fad7d7 100644 (file)
@@ -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!' />}
index 16ce6ed10399219f5fd3fdbdfd0ff8e62dbebeb6..81f0b24c4d6766a08bab443d3a058c0a7a8484ae 100644 (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 = () => {
     this.column.scrollTop();
   }
@@ -76,7 +71,6 @@ export default class Favourites extends ImmutablePureComponent {
         />
         <ScrollableList
           scrollKey='favourites'
-          shouldUpdateScroll={this.shouldUpdateScroll}
           emptyMessage={emptyMessage}
         >
           {accountIds.map(id =>
index eacf1e0ac95a4354075c0c8f612d3bf96f9ec6a7..89340320e5c088b315aa031181cff4a95af8f271 100644 (file)
@@ -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 =>
index 704e0c92e000b187c00a0c721d9f73a03ab1d9e7..c57a2b1a203b5c1aeaf70ba42d1c4876d8960c19 100644 (file)
@@ -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}
index 46cc773e7bf94c7b53e7fd2d3dd1e619d52ba549..b61f8398800c3656ab1c5e21d1e303b1f66b80db 100644 (file)
@@ -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}
index 35c15deec8cad751a8d351cc208a31be989eb72f..e5b5bb46d121788cc1fd60e9878151013f138205 100644 (file)
@@ -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 =>
index 7fe47220280115c7f624100b8d781f509248c3cb..e5f5171aa336dcb3bb04dbe30dce58d87c5b1a65 100644 (file)
@@ -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;
index cb1dc5c29b45e2e538858901e6d6f679dfef33de..14f44a20afb87da0269e8f24f671dc999c865b07 100644 (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 = () => {
     this.column.scrollTop();
   }
@@ -77,7 +72,6 @@ export default class Reblogs extends ImmutablePureComponent {
 
         <ScrollableList
           scrollKey='reblogs'
-          shouldUpdateScroll={this.shouldUpdateScroll}
           emptyMessage={emptyMessage}
         >
           {accountIds.map(id =>