unread: Remove suppress_unread_counts flag.

This flag was used to delay unread count updates while the bankruptcy
modal was visible.  Now that bankrupcty is no longer a modal, we don't
need this flag at all.
This commit is contained in:
Tim Abbott 2020-03-31 15:19:33 -07:00
parent e85e598e56
commit 0f238f29fb
5 changed files with 1 additions and 24 deletions

View File

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

View File

@ -134,9 +134,6 @@ exports.matches_filter = function (filter_text, user_id) {
};
function get_num_unread(user_id) {
if (unread.suppress_unread_counts) {
return 0;
}
return unread.num_unread_for_person(user_id.toString());
}

View File

@ -94,10 +94,6 @@ exports.initialize = function () {
resize_app();
});
$("#bankruptcy").on("hide", function () {
unread_ui.enable();
});
$("#panels").on("click", ".alert .close, .alert .exit", function (e) {
e.stopPropagation();
const $process = $(e.target).closest("[data-process]");

View File

@ -13,10 +13,6 @@ const FoldDict = require('./fold_dict').FoldDict;
// See https://zulip.readthedocs.io/en/latest/subsystems/pointer.html
// for more details on how this system is designed.
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

@ -35,10 +35,6 @@ exports.set_count_toggle_button = function (elem, count) {
};
exports.update_unread_counts = function () {
if (unread.suppress_unread_counts) {
return;
}
// Pure computation:
const res = unread.get_counts();
@ -59,11 +55,6 @@ exports.update_unread_counts = function () {
};
exports.enable = function enable() {
unread.set_suppress_unread_counts(false);
exports.update_unread_counts();
};
exports.should_display_bankruptcy_banner = function () {
// Until we've handled possibly declaring bankruptcy, don't show
// unread counts since they only consider messages that are loaded
@ -72,7 +63,6 @@ exports.should_display_bankruptcy_banner = function () {
if (!page_params.furthest_read_time) {
// We've never read a message.
exports.enable();
return false;
}
@ -82,12 +72,11 @@ exports.should_display_bankruptcy_banner = function () {
return true;
}
exports.enable();
return false;
};
exports.initialize = function () {
exports.enable();
exports.update_unread_counts();
};
window.unread_ui = exports;