-
-
Notifications
You must be signed in to change notification settings - Fork 674
settings_page: Add marks as read on scroll options #5294
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ declare var isDevelopment: boolean; | |
| * defined in `handleInitialLoad`. | ||
| * declared globally so as to use across functions. | ||
| */ | ||
| declare var doNotMarkMessagesAsRead: boolean; | ||
| declare var shouldMarkAsReadOnScroll: 'never' | 'always' | 'conversation'; | ||
|
|
||
| // We pull out document.body in one place, and check it's not null, in order | ||
| // to provide that assertion to the type-checker. | ||
|
|
@@ -471,7 +471,7 @@ const sendScrollMessage = () => { | |
| startMessageId: rangeHull.first, | ||
| endMessageId: rangeHull.last, | ||
| }); | ||
| if (!doNotMarkMessagesAsRead) { | ||
| if (shouldMarkAsReadOnScroll === 'always' || shouldMarkAsReadOnScroll === 'conversation') { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This conditional is not entirely correct. setMessagesReadAttributes(rangeHull), should only work if the chosen setting is 'always' or the settings is 'conversation' and the current narrow is a topic or pm. Is there a way to check which narrow we are currently in the js.js file? |
||
| setMessagesReadAttributes(rangeHull); | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like the place where the setting actually takes effect; is that right? It seems like this bit should be replaced with something different, instead of removed altogether. |
||
| // If there are no visible + read messages (for instance, the entire screen | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for the search, starred, and mentioned narrows, every other narrows should depend on the currently chosen setting. That's why I added this extra parameter