aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app/javascript
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-07-27 00:11:22 -0400
committerGeorge Claghorn <george@basecamp.com>2018-07-27 00:11:22 -0400
commit195463736cfe21971171aa911dfb45d25dc87354 (patch)
tree20c2b30bc17cabb1965c1b4a38c7778a225ee2c0 /activestorage/app/javascript
parent36f28fd8184a999f82bd8b0388e31798bd856ae0 (diff)
downloadrails-195463736cfe21971171aa911dfb45d25dc87354.tar.gz
rails-195463736cfe21971171aa911dfb45d25dc87354.tar.bz2
rails-195463736cfe21971171aa911dfb45d25dc87354.zip
Fix directly uploading zero-byte files
Closes #33450.
Diffstat (limited to 'activestorage/app/javascript')
-rw-r--r--activestorage/app/javascript/activestorage/file_checksum.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/activestorage/app/javascript/activestorage/file_checksum.js b/activestorage/app/javascript/activestorage/file_checksum.js
index ffaec1a128..d46f276957 100644
--- a/activestorage/app/javascript/activestorage/file_checksum.js
+++ b/activestorage/app/javascript/activestorage/file_checksum.js
@@ -39,7 +39,7 @@ export class FileChecksum {
}
readNextChunk() {
- if (this.chunkIndex < this.chunkCount) {
+ if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {
const start = this.chunkIndex * this.chunkSize
const end = Math.min(start + this.chunkSize, this.file.size)
const bytes = fileSlice.call(this.file, start, end)