Skip to content

Commit dff8f70

Browse files
authored
fix(status): fix undefined AV error (#403)
1 parent 3483e7e commit dff8f70

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/status.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
const _ = require('underscore');
22
const AVRequest = require('./request').request;
33

4-
const getUser = (options = {}) => AV.User.currentAsync()
5-
.then(currUser => currUser
6-
? currUser
7-
: AV.User._fetchUserBySessionToken(options.sessionToken));
8-
9-
const getUserPointer = options => getUser(options)
10-
.then(currUser => AV.Object.createWithoutData('_User', currUser.id)._toPointer());
4+
module.exports = function(AV) {
5+
const getUser = (options = {}) => AV.User.currentAsync()
6+
.then(currUser => currUser || AV.User._fetchUserBySessionToken(options.sessionToken));
117

8+
const getUserPointer = options => getUser(options)
9+
.then(currUser => AV.Object.createWithoutData('_User', currUser.id)._toPointer());
1210

13-
module.exports = function(AV) {
1411
/**
1512
* Contains functions to deal with Status in LeanCloud.
1613
* @class

0 commit comments

Comments
 (0)