web-manager 3.1.14 → 3.1.16

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 +3 -23
  2. package/package.json +2 -2
package/lib/account.js CHANGED
@@ -156,6 +156,9 @@ Account.prototype.resolve = function (account, options) {
156
156
  return new Promise(function(resolve, reject) {
157
157
  var currentUser = firebase.auth().currentUser;
158
158
 
159
+ account = account || {};
160
+ options = options || {};
161
+
159
162
  // If there is no user logged in or we choose not to fetch the account, resolve a default account
160
163
  if (!currentUser || !currentUser.uid || options.fetchNewAccount === false) {
161
164
  return resolve(self._resolveAccount(currentUser, account, options));
@@ -170,29 +173,6 @@ Account.prototype.resolve = function (account, options) {
170
173
  });
171
174
  }
172
175
 
173
- Account.prototype.resolve = function (account, options) {
174
- var self = this;
175
- return new Promise(function(resolve, reject) {
176
- var currentUser = firebase.auth().currentUser;
177
- if (!account || !account.auth) {
178
- if (!currentUser) {
179
- return reject(new Error('Malformed <account> input and no currently authenticated user'))
180
- }
181
- firebase.firestore().doc('users/' + currentUser.uid)
182
- .get()
183
- .then(function (doc) {
184
- return resolve(self._resolveAccount(currentUser, doc.data(), options));
185
- })
186
- .catch(reject)
187
- } else {
188
- if (!currentUser) {
189
- return reject(new Error('No currently authenticated user'))
190
- }
191
- return resolve(self._resolveAccount(currentUser, account, options));
192
- }
193
- });
194
- }
195
-
196
176
  function _setAuthItem(selector, value) {
197
177
  dom.select(selector).each(function(e, i) {
198
178
  if (e.tagName === 'INPUT') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.1.14",
3
+ "version": "3.1.16",
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": {
@@ -28,4 +28,4 @@
28
28
  "firebase": "^8.10.1",
29
29
  "lazysizes": "^5.3.2"
30
30
  }
31
- }
31
+ }