From e0b7acd3686e0ad60f8b739ec56cd96d8cce931e Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 19 Sep 2021 17:56:46 -0300 Subject: [PATCH] Fix Achievements (shut up harmony) --- src/views/achievements/reducers/AchievementsReducer.tsx | 6 ++++-- .../achievements/views/category/AchievementCategoryView.tsx | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/views/achievements/reducers/AchievementsReducer.tsx b/src/views/achievements/reducers/AchievementsReducer.tsx index 460d998a..8ae9f004 100644 --- a/src/views/achievements/reducers/AchievementsReducer.tsx +++ b/src/views/achievements/reducers/AchievementsReducer.tsx @@ -43,13 +43,15 @@ export const AchievementsReducer: Reducer 0) { - selectedCategoryName = categories[0].name; + selectedCategoryName = categories[0].name; + selectedAchievementId = categories[0].achievements[0].achievementId; } - return { ...state, categories, selectedCategoryName }; + return { ...state, categories, selectedCategoryName, selectedAchievementId }; } case AchievementsActions.SET_SCORE: { const score = (action.payload.score || state.score || null); diff --git a/src/views/achievements/views/category/AchievementCategoryView.tsx b/src/views/achievements/views/category/AchievementCategoryView.tsx index 8d59bba5..879c4d84 100644 --- a/src/views/achievements/views/category/AchievementCategoryView.tsx +++ b/src/views/achievements/views/category/AchievementCategoryView.tsx @@ -58,7 +58,7 @@ export const AchievementCategoryView: FC = props =
{ LocalizeText('quests.' + selectedCategoryName + '.name') }
IMAGE
-
+ { selectedAchievement &&
@@ -66,7 +66,7 @@ export const AchievementCategoryView: FC = props =
{ LocalizeBadgeName(selectedAchievement.badgeId) }
{ LocalizeBadgeDescription(selectedAchievement.badgeId) }
-
+ }
{ getSelectedCategory().achievements.map((achievement, index) =>