Skip to content

Commit acdade5

Browse files
authored
Merge pull request #368 from leeyeh/chore-port-1.5.0
chore: port changes from v1.4.0 to v1.5.0
2 parents 7ba81ae + c34de5c commit acdade5

File tree

7 files changed

+741
-10
lines changed

7 files changed

+741
-10
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"react-native": {
6666
"react-native": "react-native"
6767
},
68+
"typings": "./storage.d.ts",
6869
"eslintConfig": {
6970
"env": {
7071
"es6": true,

src/file.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ module.exports = function(AV) {
352352
}
353353
this._source = Promise.resolve({ data: data.blob, type: guessedType });
354354
} else if (typeof File !== "undefined" && data instanceof global.File) {
355+
if (data.size) {
356+
this.attributes.metaData.size = data.size;
357+
}
355358
this._source = Promise.resolve({ data, type: guessedType });
356359
} else if (typeof global.Buffer !== "undefined" && global.Buffer.isBuffer(data)) {
357360
// use global.Buffer to prevent browserify pack Buffer module

src/user.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,16 @@ module.exports = function(AV) {
531531
return this._sessionToken;
532532
},
533533

534+
/**
535+
* Get this user's Roles.
536+
* @param {AuthOptions} [options]
537+
* @return {Promise} A promise that is fulfilled with the roles when
538+
* the query is complete.
539+
*/
540+
getRoles(options) {
541+
return AV.Relation.reverseQuery("_Role", "users", this).find(options);
542+
},
543+
534544
}, /** @lends AV.User */ {
535545
// Class Variables
536546

0 commit comments

Comments
 (0)