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.

stream_topic_history: Simplify add_or_update params.

evykassirer8a1fa8b1615f
diff --git a/web/src/stream_topic_history.js b/web/src/stream_topic_history.js
index 6c408369f95..1554e0953ee 100644
--- a/web/src/stream_topic_history.js
+++ b/web/src/stream_topic_history.js
@@ -121,7 +121,7 @@ export class PerStreamHistory {
}
}
- add_or_update({topic_name, message_id = 0}) {
+ add_or_update(topic_name, message_id) {
message_id = Number.parseInt(message_id, 10);
this.update_stream_max_message_id(message_id);
@@ -276,15 +276,12 @@ export function find_or_create(stream_id) {
export function add_message(opts) {
const stream_id = opts.stream_id;
- const message_id = opts.message_id;
+ const message_id = opts.message_id ?? 0;
const topic_name = opts.topic_name;
const history = find_or_create(stream_id);
- history.add_or_update({
- topic_name,
- message_id,
- });
+ history.add_or_update(topic_name, message_id);
}
export function add_history(stream_id, server_history) {