unread.js: Add setter for suppress_unread_counts.

After migration to an ES6 module, `suppress_unread_counts` would no
longer be mutable from outside the module.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2018-08-04 02:44:31 -04:00 committed by Tim Abbott
parent e24ec31823
commit 9368c33098
3 changed files with 5 additions and 2 deletions

View File

@ -699,7 +699,7 @@ run_test('insert_unfiltered_user_with_filter', () => {
run_test('realm_presence_disabled', () => {
page_params.realm_presence_disabled = true;
unread.suppress_unread_counts = false;
unread.set_suppress_unread_counts(false);
activity.redraw_user();
activity.build_user_sidebar();

View File

@ -8,6 +8,9 @@ var unread = (function () {
var exports = {};
exports.suppress_unread_counts = true;
exports.set_suppress_unread_counts = function (value) {
exports.suppress_unread_counts = value;
};
exports.messages_read_in_narrow = false;
exports.set_messages_read_in_narrow = function (value) {
exports.messages_read_in_narrow = value;

View File

@ -62,7 +62,7 @@ exports.update_unread_counts = function () {
};
exports.enable = function enable() {
unread.suppress_unread_counts = false;
unread.set_suppress_unread_counts(false);
exports.update_unread_counts();
};