Merge branch '1.0-develop' into develop

This commit is contained in:
Matthew Penner 2022-12-12 14:06:52 -07:00
commit e64e28839b
No known key found for this signature in database
8 changed files with 73 additions and 60 deletions

View file

@ -23,6 +23,7 @@ interface ServerFileStore {
setUploadProgress: Action<ServerFileStore, { name: string; loaded: number }>;
clearFileUploads: Action<ServerFileStore>;
removeFileUpload: Action<ServerFileStore, string>;
cancelFileUpload: Action<ServerFileStore, string>;
}
const files: ServerFileStore = {
@ -71,6 +72,15 @@ const files: ServerFileStore = {
return;
}
delete state.uploads[payload];
}),
cancelFileUpload: action((state, payload) => {
const upload = state.uploads[payload];
if (upload === undefined) {
return;
}
// Abort the request if it is still in flight. If it already completed this is
// a no-op.
upload.abort.abort();