Skip to content

Commit

Permalink
Fix: Minor achievement and notification issues (#676)
Browse files Browse the repository at this point in the history
## What was done?

- Skip achievementById query if no id is given
- Include `navigateTo` when receiving new inApp notification to allow
onClick event on floating component
  • Loading branch information
JeangelLF authored Sep 30, 2024
1 parent e56ce71 commit f429f2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/hooks/useConcreteNotification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const concreteNotificationQuery = gql(`
body
modalText
type
navigateTo
}
sentAt
}
Expand Down
2 changes: 1 addition & 1 deletion src/modals/AchievementMessageModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ query achievementById($achievementId: Float!) {
}`);

const AchievementMessageModal: React.FC<{ achievementId: number; isOpenModal: boolean; onClose: () => void }> = ({ achievementId, isOpenModal, onClose }) => {
const { data } = useQuery(ACHIEVMENT_BY_ID_QUERY, { variables: { achievementId } });
const { data } = useQuery(ACHIEVMENT_BY_ID_QUERY, { variables: { achievementId }, skip: !achievementId });
const achievement = data?.me.achievement;

if (achievement) {
Expand Down

0 comments on commit f429f2e

Please sign in to comment.