ui: Move update_message_lists related functions to other related modules.

This commit moves mainly two functions from `ui.js` to `message_live_update`,
`update_message_in_all_views` and `update_starred_view`. This is done in favor of
eliminating `ui.js` and also these functions are more closely related to
`message_live_update` module than to `ui` module.

We also move `show_message_failed` and `show_failed_message_success` to `echo.js`
for cleaner seperation of responsibilities.
This commit is contained in:
Lalit
2023-04-25 09:06:10 +05:30
committed by Tim Abbott
parent aad2f7c7c5
commit 7e52509ee7
7 changed files with 65 additions and 78 deletions

View File

@@ -6,7 +6,7 @@ const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespac
const {run_test} = require("./lib/test");
const channel = mock_esm("../src/channel");
const ui = mock_esm("../src/ui");
const message_live_update = mock_esm("../src/message_live_update");
mock_esm("../src/starred_messages", {
add() {},
@@ -22,7 +22,7 @@ run_test("starred", ({override}) => {
};
let ui_updated;
override(ui, "update_starred_view", () => {
override(message_live_update, "update_starred_view", () => {
ui_updated = true;
});
@@ -76,7 +76,7 @@ run_test("starring local echo", () => {
message_flags.toggle_starred_and_update_server(locally_echoed_message);
// ui.update_starred_view not called
// message_live_update.update_starred_view not called
// channel post request not made