mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 10:57:58 +00:00
Remove redundant narrow_state.get_current_filter().
We now use narrow_state.filter() everywhere. The two functions did the same thing, and I slightly prefer the concise name, which was already in use in lots of places.
This commit is contained in:
@@ -26,7 +26,7 @@ function test_with(fixture) {
|
||||
|
||||
const muting_enabled = narrow_state.muting_enabled();
|
||||
const msg_data = new MessageListData({
|
||||
filter: narrow_state.get_current_filter(),
|
||||
filter: narrow_state.filter(),
|
||||
muting_enabled: muting_enabled,
|
||||
});
|
||||
const id_info = {
|
||||
|
||||
@@ -275,7 +275,7 @@ exports.respond_to_message = function (opts) {
|
||||
compose.nonexistent_stream_reply_error();
|
||||
return;
|
||||
}
|
||||
var current_filter = narrow_state.get_current_filter();
|
||||
var current_filter = narrow_state.filter();
|
||||
var first_term = current_filter.operators()[0];
|
||||
var first_operator = first_term.operator;
|
||||
var first_operand = first_term.operand;
|
||||
|
||||
@@ -148,7 +148,7 @@ exports.activate = function (raw_operators, opts) {
|
||||
exports.save_pre_narrow_offset_for_reload();
|
||||
|
||||
var msg_data = new MessageListData({
|
||||
filter: narrow_state.get_current_filter(),
|
||||
filter: narrow_state.filter(),
|
||||
muting_enabled: muting_enabled,
|
||||
});
|
||||
|
||||
@@ -169,7 +169,7 @@ exports.activate = function (raw_operators, opts) {
|
||||
// maybe_add_local_messages is likely not be contiguous with
|
||||
// the block we're about to request from the server instead.
|
||||
msg_data = new MessageListData({
|
||||
filter: narrow_state.get_current_filter(),
|
||||
filter: narrow_state.filter(),
|
||||
muting_enabled: muting_enabled,
|
||||
});
|
||||
}
|
||||
@@ -177,7 +177,7 @@ exports.activate = function (raw_operators, opts) {
|
||||
var msg_list = new message_list.MessageList({
|
||||
data: msg_data,
|
||||
table_name: 'zfilt',
|
||||
collapse_messages: !narrow_state.get_current_filter().is_search(),
|
||||
collapse_messages: !narrow_state.filter().is_search(),
|
||||
});
|
||||
|
||||
msg_list.start_time = start_time;
|
||||
@@ -251,7 +251,7 @@ exports.activate = function (raw_operators, opts) {
|
||||
|
||||
compose_actions.on_narrow(opts);
|
||||
|
||||
var current_filter = narrow_state.get_current_filter();
|
||||
var current_filter = narrow_state.filter();
|
||||
|
||||
top_left_corner.handle_narrow_activated(current_filter);
|
||||
stream_list.handle_narrow_activated(current_filter);
|
||||
@@ -311,7 +311,7 @@ exports.maybe_add_local_messages = function (opts) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We can now assume narrow_state.get_current_filter().can_apply_locally(),
|
||||
// We can now assume narrow_state.filter().can_apply_locally(),
|
||||
// because !can_apply_locally => cannot_compute
|
||||
|
||||
if (unread_info.flavor === 'found') {
|
||||
@@ -586,7 +586,7 @@ exports.by_recipient = function (target_id, opts) {
|
||||
};
|
||||
|
||||
exports.deactivate = function () {
|
||||
if (narrow_state.get_current_filter() === undefined) {
|
||||
if (narrow_state.filter() === undefined) {
|
||||
return;
|
||||
}
|
||||
unnarrow_times = {start_time: new Date()};
|
||||
@@ -684,7 +684,7 @@ exports.restore_home_state = function () {
|
||||
function pick_empty_narrow_banner() {
|
||||
var default_banner = $('#empty_narrow_message');
|
||||
|
||||
var current_filter = narrow_state.get_current_filter();
|
||||
var current_filter = narrow_state.filter();
|
||||
|
||||
if (current_filter === undefined) {
|
||||
return default_banner;
|
||||
|
||||
@@ -12,10 +12,6 @@ exports.set_current_filter = function (filter) {
|
||||
current_filter = filter;
|
||||
};
|
||||
|
||||
exports.get_current_filter = function () {
|
||||
return current_filter;
|
||||
};
|
||||
|
||||
exports.active = function () {
|
||||
return current_filter !== undefined;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user