Skip to content

Commit 7806a49

Browse files
authored
fix(sidebar): unread count (#2361)
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent 0b432bc commit 7806a49

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/renderer/components/Sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const Sidebar: FC = () => {
3535
status,
3636
settings,
3737
auth,
38-
unreadCount,
38+
unreadNotificationCount,
3939
hasUnreadNotifications,
4040
} = useContext(AppContext);
4141

@@ -92,7 +92,7 @@ export const Sidebar: FC = () => {
9292
<IconButton
9393
aria-label="Notifications"
9494
data-testid="sidebar-notifications"
95-
description={`${unreadCount} unread notifications ↗`}
95+
description={`${unreadNotificationCount} unread notifications ↗`}
9696
icon={BellIcon}
9797
onClick={() => openGitHubNotifications(primaryAccountHostname)}
9898
size="small"

src/renderer/context/App.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ interface AppContextState {
7777
globalError: GitifyError;
7878

7979
notifications: AccountNotifications[];
80-
unreadCount: number;
81-
hasUnreadNotifications: boolean;
80+
notificationCount: number;
81+
unreadNotificationCount: number;
8282
hasNotifications: boolean;
83+
hasUnreadNotifications: boolean;
84+
8385
fetchNotifications: () => Promise<void>;
8486
removeAccountNotifications: (account: Account) => Promise<void>;
85-
8687
markNotificationsAsRead: (notifications: Notification[]) => Promise<void>;
8788
markNotificationsAsDone: (notifications: Notification[]) => Promise<void>;
8889
unsubscribeNotification: (notification: Notification) => Promise<void>;
@@ -375,8 +376,8 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
375376
unreadNotificationCount,
376377
hasNotifications,
377378
hasUnreadNotifications,
378-
fetchNotifications: fetchNotificationsWithAccounts,
379379

380+
fetchNotifications: fetchNotificationsWithAccounts,
380381
markNotificationsAsRead: markNotificationsAsReadWithAccounts,
381382
markNotificationsAsDone: markNotificationsAsDoneWithAccounts,
382383
unsubscribeNotification: unsubscribeNotificationWithAccounts,
@@ -403,6 +404,7 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
403404
unreadNotificationCount,
404405
hasNotifications,
405406
hasUnreadNotifications,
407+
406408
fetchNotificationsWithAccounts,
407409
markNotificationsAsReadWithAccounts,
408410
markNotificationsAsDoneWithAccounts,

0 commit comments

Comments
 (0)