roboto-js 1.4.47 → 1.4.49

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.
@@ -61,7 +61,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
61
61
  }
62
62
  this.localDb = null;
63
63
  this.iac_session = null;
64
- this.appServiceHost = null;
64
+ this.appServiceHost = baseUrl;
65
65
  this.requestCache = {};
66
66
 
67
67
  // Use the storageAdaptor to get the authToken, if available
@@ -436,8 +436,14 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
436
436
  return this.loadCurrentUser();
437
437
  case 2:
438
438
  currentUser = _context9.sent;
439
+ if (!currentUser) {
440
+ _context9.next = 7;
441
+ break;
442
+ }
439
443
  return _context9.abrupt("return", this.loadUser(currentUser.id));
440
- case 4:
444
+ case 7:
445
+ return _context9.abrupt("return", null);
446
+ case 8:
441
447
  case "end":
442
448
  return _context9.stop();
443
449
  }
@@ -33,7 +33,7 @@ export default class RbtApi {
33
33
  }
34
34
  this.localDb = null;
35
35
  this.iac_session = null;
36
- this.appServiceHost = null;
36
+ this.appServiceHost = baseUrl;
37
37
  this.requestCache = {};
38
38
 
39
39
  // Use the storageAdaptor to get the authToken, if available
@@ -200,7 +200,11 @@ export default class RbtApi {
200
200
  }
201
201
  async loadCurrentUserExtended() {
202
202
  let currentUser = await this.loadCurrentUser();
203
- return this.loadUser(currentUser.id);
203
+ if (currentUser) {
204
+ return this.loadUser(currentUser.id);
205
+ } else {
206
+ return null;
207
+ }
204
208
  }
205
209
  async loadUser(userId) {
206
210
  let params = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboto-js",
3
- "version": "1.4.47",
3
+ "version": "1.4.49",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/cjs/index.cjs",
package/src/rbt_api.js CHANGED
@@ -32,7 +32,7 @@ export default class RbtApi {
32
32
  }
33
33
  this.localDb = null;
34
34
  this.iac_session = null;
35
- this.appServiceHost = null;
35
+ this.appServiceHost = baseUrl;
36
36
  this.requestCache = {};
37
37
 
38
38
  // Use the storageAdaptor to get the authToken, if available
@@ -256,7 +256,12 @@ export default class RbtApi {
256
256
  async loadCurrentUserExtended(){
257
257
 
258
258
  let currentUser = await this.loadCurrentUser();
259
- return this.loadUser(currentUser.id);
259
+ if(currentUser){
260
+ return this.loadUser(currentUser.id);
261
+ }
262
+ else{
263
+ return null;
264
+ }
260
265
 
261
266
  }
262
267