Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
upload: Immediately re-enable send after upload completes.
Alex Vandiver2d758951b48a
diff --git a/web/src/upload.ts b/web/src/upload.tsindex 5540bd75e0c..0947bacf8a9 100644--- a/web/src/upload.ts+++ b/web/src/upload.ts@@ -125,8 +125,20 @@ export function edit_config(row: number): Config {};}-export let hide_upload_banner = (uppy: Uppy, config: Config, file_id: string): void => {- config.upload_banner(file_id).remove();+export let hide_upload_banner = (+ uppy: Uppy,+ config: Config,+ file_id: string,+ delay = 0,+): void => {+ if (delay > 0) {+ setTimeout(() => {+ config.upload_banner(file_id).remove();+ }, delay);+ } else {+ config.upload_banner(file_id).remove();+ }+if (uppy.getFiles().length === 0) {if (config.mode === "compose") {compose_validate.set_upload_in_progress(false);@@ -414,9 +426,7 @@ export function setup_upload(config: Config): Uppy {uppy.removeFile(file.id);// Hide upload status after waiting 100ms after the 1s transition to 100%// so that the user can see the progress bar at 100%.- setTimeout(() => {- hide_upload_banner(uppy, config, file.id);- }, 1100);+ hide_upload_banner(uppy, config, file.id, 1100);});uppy.on("info-visible", () => {diff --git a/web/tests/upload.test.cjs b/web/tests/upload.test.cjsindex 3bf5a84b9f8..d55edee6cfb 100644--- a/web/tests/upload.test.cjs+++ b/web/tests/upload.test.cjs@@ -471,6 +471,9 @@ test("uppy_events", ({override_rewire, mock_template}) => {callbacks[event_name] = callback;},removeFile() {},+ getFiles() {+ return [];+ },getState: () => ({info: [{