Skip to content

Commit 4b29058

Browse files
committed
πŸ‘¨β€πŸ’» Address issues from #57 + remove underscore dependency
Thank you @jankapunkt, let me know wdyt?
1 parent 668f87c commit 4b29058

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

β€Žlib/client/fileUpload.jsβ€Ž

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { _ } from 'meteor/underscore';
21
import { Meteor } from 'meteor/meteor';
32
import { AutoForm } from 'meteor/aldeed:autoform';
43
import { Template } from 'meteor/templating';
@@ -52,15 +51,19 @@ Template.afFileUpload.onCreated(function () {
5251
this.uploadTemplate = this.data.atts.uploadTemplate || null;
5352
this.previewTemplate = this.data.atts.previewTemplate || null;
5453
this.accept = this.data.atts.accept || null;
55-
this.insertConfig = Object.assign({}, this.data.atts.insertConfig || {});
54+
this.insertConfig = Object.assign({}, defaultInsertOpts, this.data.atts.insertConfig || {});
5655
delete this.data.atts.insertConfig;
57-
this.insertConfig = Object.assign(this.insertConfig, _.pick(this.data.atts, Object.keys(defaultInsertOpts)));
5856

59-
if (!isNaN(this.insertConfig.streams) || this.insertConfig.streams !== 'dynamic') {
57+
if (!isNaN(this.insertConfig.streams)) {
6058
this.insertConfig.streams = parseInt(this.insertConfig.streams);
59+
} else if (this.insertConfig.streams !== 'dynamic') {
60+
this.insertConfig.streams = 'dynamic';
6161
}
62-
if (!isNaN(this.insertConfig.chunkSize) || this.insertConfig.chunkSize !== 'dynamic') {
62+
63+
if (!isNaN(this.insertConfig.chunkSize)) {
6364
this.insertConfig.chunkSize = parseInt(this.insertConfig.chunkSize);
65+
} else if (this.insertConfig.chunkSize !== 'dynamic') {
66+
this.insertConfig.chunkSize = 'dynamic';
6467
}
6568

6669
this.collectionName = function () {

0 commit comments

Comments
Β (0)