Skip to content

Commit

Permalink
fix(issue-3148): removed extra loading condition in PlayerHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
jeyren95 committed Feb 7, 2024
1 parent 821084e commit 93d8070
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
16 changes: 6 additions & 10 deletions src/components/Player/Header/PlayerHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,21 +277,19 @@ const PlayerHeader = ({
picture,
registered,
plus,
playerLoading,
playerError,
loading,
error,
small,
playerSoloCompetitiveRank,
loggedInUser,
rankTier,
leaderboardRank,
strings,
playerWinLossLoading,
playerWinLossError,
}) => {
if (playerError || playerWinLossError) {
if (error) {
return <Error />;
}
if (playerLoading || playerWinLossLoading) {
if (loading) {
return <Facebook primaryColor="#666" secondaryColor="#ecebeb" width={400} height={60} animate />;
}

Expand Down Expand Up @@ -373,10 +371,8 @@ PlayerHeader.propTypes = {
};

const mapStateToProps = state => ({
playerLoading: state.app.player.loading,
playerWinLossLoading: state.app.playerWinLoss.loading,
playerError: state.app.player.error,
playerWinLossError: state.app.playerWinLoss.error,
loading: state.app.player.loading,
error: state.app.player.error,
playerName: (state.app.player.data.profile || {}).personaname,
officialPlayerName: (state.app.player.data.profile || {}).name,
playerSoloCompetitiveRank: state.app.player.data.solo_competitive_rank,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Player/Header/PlayerStats.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
// import ActionHelp from 'material-ui/svg-icons/action/help';
import styled from 'styled-components';
import { Facebook } from 'react-content-loader';
import Spinner from '../../Spinner';
import Error from '../../Error';
import PlayedWith from './PlayedWith';
import { PlayerStatsCard } from './Styled';
Expand Down Expand Up @@ -68,7 +68,7 @@ export const PlayerStatsCards = ({
return <Error />;
}
if (loading) {
return <Facebook primaryColor="#666" secondaryColor="#ecebeb" width={400} height={60} animate />;
return <Spinner />;
}
return (
<Styled>
Expand Down

0 comments on commit 93d8070

Please sign in to comment.