Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃惔] Decrement app badge when opening unread chat #4040

Merged
merged 4 commits into from
May 16, 2024

Conversation

haileyok
Copy link
Member

  • Decrement the badge when opening a chat from the messages list
  • Decrement the badge when opening a chat from a push notification
  • Increment the badge every time you receive a notification for a chat
    • EXCEPT for if it is the chat you are currently looking at

Copy link

render bot commented May 16, 2024

@haileyok haileyok force-pushed the hailey/decrement-badge-on-open-chat branch from e5b0a20 to b303c88 Compare May 16, 2024 03:35
Copy link

github-actions bot commented May 16, 2024

Old size New size Diff
6.82 MB 6.82 MB 751 B (0.01%)

if (convo.unreadCount > 0) {
// We only increment the badge once per conversation, so even if there are multiple unreads
// we only want to decrement by one.
decrementBadgeCount(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're doing markAsRead within the ConvoProvider, could be a good spot for this too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah pry good to do there in case you foreground the app directly to the convo page

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh okay perfect let me adjust to that, wasn't sure if we did it or the server did it for us.

src/lib/hooks/useNotificationHandler.ts Outdated Show resolved Hide resolved
@haileyok haileyok merged commit 5e8650a into main May 16, 2024
6 checks passed
@haileyok haileyok deleted the hailey/decrement-badge-on-open-chat branch May 16, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants