From 8a1fa8b1615fd6dd079e2049d8da63ad77f0bdae Mon Sep 17 00:00:00 2001 From: evykassirer Date: Wed, 3 Jan 2024 13:25:13 -0800 Subject: [PATCH] stream_topic_history: Simplify add_or_update params. --- web/src/stream_topic_history.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/web/src/stream_topic_history.js b/web/src/stream_topic_history.js index 6c408369f9..1554e0953e 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) {