Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message_list_data: Replace lodash with standard Array methods.

Anders Kaseorg19110b80de37
diff --git a/static/js/message_list_data.js b/static/js/message_list_data.js
index a8ad1449278..9713928839b 100644
--- a/static/js/message_list_data.js
+++ b/static/js/message_list_data.js
@@ -1,5 +1,3 @@
-import _ from "lodash";
-
import * as blueslip from "./blueslip";
import {FetchStatus} from "./fetch_status";
import {Filter} from "./filter";
@@ -541,7 +539,7 @@ export class MessageListData {
}
get_messages_sent_by_user(user_id) {
- const msgs = _.filter(this._items, {sender_id: user_id});
+ const msgs = this._items.filter((msg) => msg.sender_id === user_id);
if (msgs.length === 0) {
return [];
}
@@ -549,7 +547,7 @@ export class MessageListData {
}
get_last_message_sent_by_me() {
- const msg_index = _.findLastIndex(this._items, {sender_id: page_params.user_id});
+ const msg_index = this._items.findLastIndex((msg) => msg.sender_id === page_params.user_id);
if (msg_index === -1) {
return undefined;
}