mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user