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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider page visibility when marking messages as read #211

Merged
merged 2 commits into from
May 2, 2017
Merged

Conversation

dbrgn
Copy link
Contributor

@dbrgn dbrgn commented May 2, 2017

Use page visibility API to only mark messages as read if they're visible.

All browsers should be able to detect if the tab is in the background. Whether a minimized or obscured window as well as an active lockscreen ar detected, depends on the OS and browser.

PR contains vendorized angular-inview until the fix is upstream. Fixes #17 and #108. Obsoletes #210.

@dbrgn dbrgn added the enhancement Enhances functionality label May 2, 2017
@dbrgn dbrgn requested a review from sillych May 2, 2017 07:50
@CLAassistant
Copy link

CLAassistant commented May 2, 2017

CLA assistant check
All committers have signed the CLA.

@dbrgn dbrgn merged commit 033a3ab into master May 2, 2017
@dbrgn dbrgn deleted the issue-122 branch May 2, 2017 08:08
dbrgn pushed a commit that referenced this pull request Oct 23, 2018
For marking messages as unread and for triggering notifications, use
`document.hasFocus()` instead of the page visibility API.

This means that messages are only marked as read if the browser is in
the foreground and focussed. Otherwise, a notification is triggered.

Refs #211 and #17.
dbrgn pushed a commit that referenced this pull request Oct 23, 2018
For marking messages as unread and for triggering notifications, use
`document.hasFocus()` instead of the page visibility API.

This means that messages are only marked as read if the browser is in
the foreground and focussed. Otherwise, a notification is triggered.

Refs #211 and #17.
dbrgn added a commit that referenced this pull request Oct 23, 2018
For marking messages as unread and for triggering notifications, use
`document.hasFocus()` instead of the page visibility API.

This means that messages are only marked as read if the browser is in
the foreground and focussed. Otherwise, a notification is triggered.

Refs #211 and #17.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances functionality
Development

Successfully merging this pull request may close these issues.

Threema Web does not necessarily show number of unread messages
4 participants