Merge branch '1.0-develop' into develop
This commit is contained in:
commit
e64e28839b
8 changed files with 73 additions and 60 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue