File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -904,6 +904,7 @@ declare module __Backendless {
904904
905905 getCurrentUser ( ) :Backendless . User ;
906906 getCurrentUser < Promise > ( ) :Promise ;
907+ getCurrentUser ( async ?:Backendless . Async ) :void ;
907908
908909 update ( user :Backendless . User ) :Backendless . User ;
909910 update ( user :Backendless . User , async :Backendless . Async ) :XMLHttpRequest ;
Original file line number Diff line number Diff line change 17161716 }
17171717 } ,
17181718
1719- getCurrentUser : function ( ) {
1719+ getCurrentUser : function ( async ) {
17201720 if ( currentUser ) {
1721- return this . _getUserFromResponse ( currentUser ) ;
1721+ var userFromResponse = this . _getUserFromResponse ( currentUser ) ;
1722+
1723+ return async ? async . success ( userFromResponse ) : userFromResponse ;
17221724 }
17231725
17241726 var stayLoggedIn = Backendless . LocalCache . get ( "stayLoggedIn" ) ;
17251727 var currentUserId = stayLoggedIn && Backendless . LocalCache . get ( "current-user-id" ) ;
17261728
1727- return currentUserId && persistence . of ( User ) . findById ( currentUserId ) || null ;
1729+ if ( currentUserId ) {
1730+ return persistence . of ( User ) . findById ( currentUserId , async ) ;
1731+ }
1732+
1733+ return async ? async . success ( null ) : null ;
17281734 } ,
17291735
17301736 update : function ( user , async ) {
You can’t perform that action at this time.
0 commit comments