Skip to content

Commit

Permalink
fix statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-torabiv committed Dec 2, 2024
1 parent a00a54c commit 8de25d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/pages/reputation-score/[...score].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const ScorePage = () => {
const { retrieveReputationScore } = useAppStore();
const router = useRouter();

const [communityName, setCommunityName] = useState<string | null>(null);
const [reputationScore, setReputationScore] = useState<number | null>(null);
const [loading, setLoading] = useState<boolean>(true);
const [tokenId, setTokenId] = useState<string | null>(null);
Expand Down Expand Up @@ -48,7 +49,8 @@ const ScorePage = () => {
});

console.log('Reputation Score Retrieved:', score);
setReputationScore(score ?? 0);
setReputationScore(score.reputationScore ?? 0);
setCommunityName(score.communityName);
} catch (error) {
console.error('Error fetching reputation score:', error);
showMessage('Failed to load reputation score.', 'error');
Expand Down Expand Up @@ -162,7 +164,8 @@ const ScorePage = () => {
<div className='flex flex-col items-center space-y-6 py-10'>
<GaugeChart options={gaugeOptions} />
<p className='text-center text-sm text-gray-500'>
Your score is dynamically calculated from platform activity.
Your score is dynamically calculated from platform activity on{' '}
<b>{communityName}</b>
</p>
</div>
}
Expand Down
3 changes: 1 addition & 2 deletions src/pages/statistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ const Statistics = () => {
const router = useRouter();

const platform = community?.platforms.find(
(platform) =>
platform.disconnectedAt === null && platform.name === 'discord'
(platform) => platform.id === selectedPlatform
);

const isPremiumGuild: boolean = Boolean(
Expand Down

0 comments on commit 8de25d9

Please sign in to comment.