mirror of https://github.com/zulip/zulip.git
compose_banner: Remove uploads banners when clearing compose box.
Upload banners were not cleared after closing compose box, which meant that they would remain present in a paused state after compose was reopened. https://chat.zulip.org/#narrow/stream/9-issues/topic/Incomplete.20Upload.20banner.20remains.20on.20closing.20compose/near/1582602
This commit is contained in:
parent
13187ff8f6
commit
daab1d4265
|
@ -187,6 +187,7 @@ export function clear_compose_box() {
|
|||
compose_ui.autosize_textarea($("#compose-textarea"));
|
||||
compose_banner.clear_errors();
|
||||
compose_banner.clear_warnings();
|
||||
compose_banner.clear_uploads();
|
||||
compose_ui.hide_compose_spinner();
|
||||
popover_menus.reset_selected_schedule_timestamp();
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ function clear_box() {
|
|||
compose_ui.autosize_textarea($("#compose-textarea"));
|
||||
compose_banner.clear_errors();
|
||||
compose_banner.clear_warnings();
|
||||
compose_banner.clear_uploads();
|
||||
}
|
||||
|
||||
export function autosize_message_content() {
|
||||
|
|
|
@ -106,6 +106,10 @@ export function clear_warnings(): void {
|
|||
$(`#compose_banners .${CSS.escape(WARNING)}`).remove();
|
||||
}
|
||||
|
||||
export function clear_uploads(): void {
|
||||
$("#compose_banners .upload_banner").remove();
|
||||
}
|
||||
|
||||
export function clear_unmute_topic_notifications(): void {
|
||||
$(`#compose_banners .${CLASSNAMES.unmute_topic_notification.replaceAll(" ", ".")}`).remove();
|
||||
}
|
||||
|
|
|
@ -199,6 +199,7 @@ export function update_compose_for_message_type(message_type, opts) {
|
|||
}
|
||||
compose_banner.clear_errors();
|
||||
compose_banner.clear_warnings();
|
||||
compose_banner.clear_uploads();
|
||||
}
|
||||
|
||||
export function on_compose_select_recipient_update() {
|
||||
|
|
|
@ -12,6 +12,7 @@ exports.mock_banners = () => {
|
|||
}
|
||||
$("#compose_banners .warning").remove = () => {};
|
||||
$("#compose_banners .error").remove = () => {};
|
||||
$("#compose_banners .upload_banner").remove = () => {};
|
||||
|
||||
const $stub = $.create("stub_to_remove");
|
||||
const $cb = $("#compose_banners");
|
||||
|
|
Loading…
Reference in New Issue