Skip to content
Snippets Groups Projects
Commit 97cf2a15 authored by Jose Manuel Serrano Amaut's avatar Jose Manuel Serrano Amaut
Browse files

[FEAT]: Add method for setting next uploadStatus given the new status

parent 7a350f72
No related branches found
No related tags found
No related merge requests found
import * as React from "react";
import { CustomValidateFileResponse, ExtFile, ExtFileInstance, ExtFileManager, FileValidatorProps, Localization, validateExtFileList } from "../core";
import { CustomValidateFileResponse, ExtFile, ExtFileInstance, ExtFileManager, FileValidatorProps, Localization, setNextUploadStatus, validateExtFileList } from "../core";
/**
* Effect for keeping track of changes
......@@ -51,20 +51,14 @@ const useDropzoneFileListUpdater = (
//if the current Ext file is not present anymore
//add deleted flag
const extFileIndex: number = value.findIndex((extFile: ExtFile) => extFile.id === extFileInstance.id)
if (extFileIndex === -1) {
if (extFileIndex === -1) {
extFileInstance.extraData = { deleted: true }
console.log("extFileUpdater not found", extFileInstance.id);
} else {
extFileInstance.uploadStatus = value[extFileIndex].uploadStatus;
extFileInstance.uploadMessage = value[extFileIndex].uploadMessage;
if (value[extFileIndex].uploadStatus === undefined) {
console.log("extFileUpdater canceled", extFileInstance.id);
const currExtFileObj: ExtFile = value[extFileIndex];
} else if (value[extFileIndex].uploadStatus === "aborted") {
console.log("extFileUpdater aborted", extFileInstance.id);
}
setNextUploadStatus(extFileInstance, currExtFileObj);
}
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment