narrow: Add condition whether to show unread message first in narrow.

All narrows that have is: query or can mark unread message as read
will show unread message first.
This commit is contained in:
Mohit Gupta
2019-07-18 03:55:00 +05:30
committed by Tim Abbott
parent 6ec40cf9a0
commit 648a60baf6
3 changed files with 34 additions and 2 deletions

View File

@@ -378,7 +378,9 @@ Filter.prototype = {
can_mark_messages_read: function () {
return !this.has_operator('search');
},
allow_use_first_unread_when_narrowing: function () {
return this.can_mark_messages_read() || this.has_operator('is');
},
can_apply_locally: function () {
if (this.is_search()) {
// The semantics for matching keywords are implemented