diff options
author | Christian Schmidt <github@chsc.dk> | 2023-02-06 16:50:08 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-02-09 13:02:32 +0100 |
commit | 2dfbdc3f9dbca574fbeb5e27de1515a09021b9a7 (patch) | |
tree | b918978c291eaaa5c32395b11ff5d3c67242c159 /app/javascript/flavours/glitch/features/follow_requests | |
parent | 8fd6c362438b8549abc3c95389c55576af159326 (diff) |
[Glitch] Show spinner while loading follow requests
Port c1f32c9c1470d7d38342e211ff5ca326e12494fb to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/follow_requests')
-rw-r--r-- | app/javascript/flavours/glitch/features/follow_requests/index.js | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/app/javascript/flavours/glitch/features/follow_requests/index.js b/app/javascript/flavours/glitch/features/follow_requests/index.js index 7b35e3ec9..aa60bd7b8 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/index.js +++ b/app/javascript/flavours/glitch/features/follow_requests/index.js @@ -3,7 +3,6 @@ import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { debounce } from 'lodash'; -import LoadingIndicator from 'flavours/glitch/components/loading_indicator'; import Column from 'flavours/glitch/features/ui/components/column'; import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim'; import AccountAuthorizeContainer from './containers/account_authorize_container'; @@ -53,16 +52,8 @@ class FollowRequests extends ImmutablePureComponent { render () { const { intl, accountIds, hasMore, multiColumn, locked, domain, isLoading } = this.props; - if (!accountIds) { - return ( - <Column name='follow-requests'> - <LoadingIndicator /> - </Column> - ); - } - const emptyMessage = <FormattedMessage id='empty_column.follow_requests' defaultMessage="You don't have any follow requests yet. When you receive one, it will show up here." />; - const unlockedPrependMessage = locked ? null : ( + const unlockedPrependMessage = !locked && accountIds.size > 0 && ( <div className='follow_requests-unlocked_explanation'> <FormattedMessage id='follow_requests.unlocked_explanation' @@ -81,6 +72,7 @@ class FollowRequests extends ImmutablePureComponent { onLoadMore={this.handleLoadMore} hasMore={hasMore} isLoading={isLoading} + showLoading={isLoading && accountIds.size === 0} emptyMessage={emptyMessage} bindToDocument={!multiColumn} prepend={unlockedPrependMessage} |