Skip to content

Commit

Permalink
Merge pull request #925 from WatWowMap/gym-badge-fixes
Browse files Browse the repository at this point in the history
fix: gym badge fixes
  • Loading branch information
TurtIeSocks authored Jan 17, 2024
2 parents bef5385 + 1cadea0 commit 7456972
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/layout/dialogs/BadgeSelection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const footerOptions =
export default function BadgeSelection() {
const { gymId, badge, open } = useLayoutStore((s) => s.gymBadge)
const [setBadgeInDb] = useMutation(Query.user('setGymBadge'), {
refetchQueries: ['GetBadgeInfo'],
refetchQueries: ['GetBadgeInfo', 'Gyms', 'Raids', 'GymsRaids'],
})

/** @type {import('packages/types/lib').MultiSelectorProps<typeof badge>['onClick']} */
Expand Down Expand Up @@ -66,7 +66,7 @@ export default function BadgeSelection() {
<DialogContent sx={{ mt: 2 }}>
<MultiSelector
items={ENUM_BADGES}
value={badge}
value={badge || 0}
onClick={onClick}
tKey="badge_"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/dialogs/profile/GymBadges.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function UserGymBadges() {
})

const counts = React.useMemo(() => {
const counter = { gold: 0, silver: 0, bronze: 0 }
const counter = { bronze: 0, silver: 0, gold: 0 }

if (data?.badges) {
data.badges.forEach((gym) => {
Expand Down
8 changes: 5 additions & 3 deletions src/components/popups/Gym.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,12 @@ const DropdownOptions = ({
if (gymBadges) {
options.push({
name: 'gym_badge_menu',
action: () =>
useLayoutStore.setState({
action: () => {
handleClose()
return useLayoutStore.setState({
gymBadge: { badge, gymId: id, open: true },
}),
})
},
})
}
}
Expand Down

0 comments on commit 7456972

Please sign in to comment.