slack_import: Allow replacing uploaded data export files.

Uppy doesn't allow uploading another file and replacing the exisiting
one in the same session due to `maxNumberOfFiles: 1` set by us.
We don't want to remove this restriction, so only way to allow
replacing files easily is to just resert the current uppy session
after the last upload finishes.

Our backend deletes any existing upload by default. So, this works
as expected on all fronts.
This commit is contained in:
Aman Agrawal
2025-05-21 12:00:51 +05:30
committed by Tim Abbott
parent 9502d8f9bf
commit 4823477a70

View File

@@ -426,6 +426,10 @@ $(() => {
$("#slack-import-start-upload-wrapper").removeClass("hidden");
$("#slack-import-uploaded-file-name").text(file.name!);
});
// Reset uppy state to allow user replace existing uploaded file.
uppy.on("complete", () => {
uppy.clear();
});
}
if ($("#slack-import-poll-status").length > 0) {