From 046bd75b0e5f7ec35f5136ccaaec6676dc1b88cc Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Fri, 27 Jul 2018 00:20:42 -0400 Subject: Clarify condition && binds tighter than || in JavaScript, but we ought not expect readers to remember language trivia. --- activestorage/app/javascript/activestorage/file_checksum.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activestorage/app') diff --git a/activestorage/app/javascript/activestorage/file_checksum.js b/activestorage/app/javascript/activestorage/file_checksum.js index d46f276957..a9dbef69ea 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 || this.chunkIndex == 0 && this.chunkCount == 0) { + 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) -- cgit v1.2.3