web-manager 2.1.28 → 2.1.29

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.
Files changed (2) hide show
  1. package/lib/account.js +12 -7
  2. package/package.json +1 -1
package/lib/account.js CHANGED
@@ -3,17 +3,21 @@
3
3
  var dom;
4
4
  var utilities;
5
5
 
6
- function Account() {
6
+ function Account(init) {
7
7
  var self = this;
8
+ init = init || {};
8
9
  self.properties = {};
9
-
10
- dom = self.Manager.dom();
11
- utilities = self.Manager.utilities();
12
-
13
10
  self.accountPageInitialized = false;
14
11
 
15
- if (new URL(window.location.href).pathname.includes('account')) {
16
- self.initializeAccountPage();
12
+ try {
13
+ dom = init.dom || self.Manager.dom();
14
+ utilities = init.utilities || self.Manager.utilities();
15
+
16
+ if (new URL(window.location.href).pathname.includes('account')) {
17
+ self.initializeAccountPage();
18
+ }
19
+ } catch (e) {
20
+ console.error('Failed to initialize libraries');
17
21
  }
18
22
 
19
23
  // var pastDate = new Date(0);
@@ -192,6 +196,7 @@ function getMonth(date) {
192
196
 
193
197
  Account.prototype._resolveAccount = function (currentUser, account, options) {
194
198
  var self = this;
199
+ currentUser = currentUser || {};
195
200
  account = account || {};
196
201
  options = options || {};
197
202
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "2.1.28",
3
+ "version": "2.1.29",
4
4
  "description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
5
5
  "main": "index.js",
6
6
  "scripts": {