@widgetic/editor 3.10.43 → 3.10.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/editor",
3
- "version": "3.10.43",
3
+ "version": "3.10.45",
4
4
  "scripts": {
5
5
  "start": "webpack --config webpack.config.js --watch --progress",
6
6
  "build": "webpack --config webpack.config.js",
@@ -29,14 +29,19 @@ const parseType = type =>
29
29
  export default class UploadService extends EventsMixin(Service) {
30
30
  constructor(user, token) {
31
31
  super();
32
+
32
33
  this.user = user.id;
33
- this.maxFilesize = user.premium ? 250 : 100;
34
34
  this.token = token;
35
35
 
36
- this.files = [];
37
36
  this.refreshed = {};
38
37
 
39
- this.quota = 1000 * 1000 * 1000;
38
+ this.files = [];
39
+ // max file size in MB
40
+ this.maxFilesize = user.premium ? 250 : 25; // MB limit / file for premium / free
41
+
42
+ // max quota in bytes
43
+ this.quota = 250 * 1000 * 1000; // 250 MB total quota for free users
44
+ // used quota in bytes
40
45
  this.used = 0;
41
46
 
42
47
  this.events = ['update', 'complete'];
@@ -88,7 +93,9 @@ export default class UploadService extends EventsMixin(Service) {
88
93
  const response = JSON.parse(uploadFile.xhr.response);
89
94
 
90
95
  const id = response.files.data[0].id;
91
- this.quota = response.quota.max;
96
+
97
+ // read quota from response
98
+ // this.quota = response.quota.max;
92
99
  this.used = response.quota.used;
93
100
 
94
101
  this._update(uploadFile, f => {
@@ -157,7 +164,9 @@ export default class UploadService extends EventsMixin(Service) {
157
164
  })
158
165
  .then(response => {
159
166
  this.refreshed[type] = true;
160
- this.quota = response.quota.max;
167
+
168
+ // read quota from response
169
+ // this.quota = response.quota.max;
161
170
  this.used = response.quota.used;
162
171
 
163
172
  return response.files.data.map(file => {