diff options
author | Sorin Davidoi <sorin.davidoi@gmail.com> | 2017-05-20 01:26:46 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-05-20 01:26:46 +0200 |
commit | b369fc2de4ab0242775a56fb6208d9dbf2109d91 (patch) | |
tree | abfdf64e22bf6da9bad418dad8ca0a58c39848de /app/javascript/mastodon/features/notifications/index.js | |
parent | 8c5eaf7ae9f78fa6bb8b2d999b36862484d12656 (diff) |
feat: Use CSS contain to avoid computations (#3158)
Diffstat (limited to 'app/javascript/mastodon/features/notifications/index.js')
-rw-r--r-- | app/javascript/mastodon/features/notifications/index.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/notifications/index.js b/app/javascript/mastodon/features/notifications/index.js index ff06a2954..ea4d9086b 100644 --- a/app/javascript/mastodon/features/notifications/index.js +++ b/app/javascript/mastodon/features/notifications/index.js @@ -100,7 +100,9 @@ class Notifications extends React.PureComponent { unread = <div className='notifications__unread-indicator' />; } - if (isLoading || notifications.size > 0) { + if (isLoading && this.scrollableArea) { + scrollableArea = this.scrollableArea; + } else if (notifications.size > 0) { scrollableArea = ( <div className='scrollable' onScroll={this.handleScroll} ref={this.setRef}> {unread} @@ -119,6 +121,8 @@ class Notifications extends React.PureComponent { ); } + this.scrollableArea = scrollableArea; + return ( <Column icon='bell' active={isUnread} heading={intl.formatMessage(messages.title)}> <ColumnSettingsContainer /> |