Created
May 23, 2019 03:19
-
-
Save majames/696b494d3475a2d7b96a485f0bd10d77 to your computer and use it in GitHub Desktop.
PR-5434
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private containerLoadingMessage = (): InflightUploadMessage | undefined => { | |
const { container } = this.state; | |
if (isUploadContainer(container)) { | |
const inflightUploadCount = this.getInflightLocalUploadsCount(container); | |
if (inflightUploadCount > 0) { | |
const { children } = container; | |
const completeUploadCount = children.length - inflightUploadCount; | |
return { | |
type: "loading", | |
str: `Uploaded ${completeUploadCount} of ${children.length} ${pluralize("files", children.length)}...`, | |
}; | |
} | |
} | |
return; | |
}; | |
const getInflightLocalUploadsCount = (container: UploadContainer): boolean => { | |
return container.children.filter(file => file.type === 'upload' && file.state.type === 'uploading').length; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment