-
Notifications
You must be signed in to change notification settings - Fork 279
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
🔍 Is there already an issue for your problem?
- I have checked older issues, open and closed
📝 Description
When opening the app (or reloading it by pressing Cmd/Control+R), notifications are loaded without their color.
The issue is caused by the following block:
Lines 69 to 78 in 1c3c248
| const { | |
| fetchNotifications, | |
| notifications, | |
| requestFailed, | |
| isFetching, | |
| markNotification, | |
| markNotificationDone, | |
| unsubscribeNotification, | |
| markRepoNotifications, | |
| } = useNotifications(settings.colors); |
When first running the app, it looks like useNotifications is called with colors: false because the settings might not have already be initialized, thus the following code block is not being called, resulting in the missing colors:
gitify/src/hooks/useNotifications.ts
Lines 142 to 163 in 1c3c248
| const cardinalData = ( | |
| await apiRequestAuth( | |
| notification.subject.url, | |
| 'GET', | |
| token, | |
| ) | |
| ).data; | |
| const state = | |
| cardinalData.state === 'closed' | |
| ? cardinalData.state_reason || | |
| (cardinalData.merged && 'merged') || | |
| 'closed' | |
| : (cardinalData.draft && 'draft') || 'open'; | |
| return { | |
| ...notification, | |
| subject: { | |
| ...notification.subject, | |
| state, | |
| }, | |
| }; |
🪜 Steps To Reproduce
- Open Gitify -> notification icons are missing their color
- Click the reload notifications button -> notifications do now have their color
ℹ System Info
`main` branch📸 Screenshots
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

