web-manager 3.2.28 → 3.2.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.
- package/index.js +54 -57
- package/package.json +1 -1
package/index.js
CHANGED
@@ -190,73 +190,70 @@ function Manager() {
|
|
190
190
|
});
|
191
191
|
setInterval(function () {
|
192
192
|
refreshNewVersion(self);
|
193
|
-
}, 1000 * 60 * 60
|
193
|
+
}, 1000 * 60 * 60); // Fetch new version every 1 hour
|
194
194
|
|
195
195
|
}
|
196
196
|
|
197
197
|
function _authStateHandler(self, user) {
|
198
198
|
// self.log('----authStateHandler', user);
|
199
|
-
if (user) {
|
200
|
-
|
201
|
-
_authHandle_in(self, user);
|
202
|
-
|
203
|
-
self.notifications().subscribe().catch(function (e) {
|
204
|
-
console.error(e);
|
205
|
-
});
|
206
|
-
} else {
|
207
|
-
_authHandle_out(self);
|
208
|
-
}
|
209
|
-
} else {
|
210
|
-
_authHandle_out(self);
|
199
|
+
if (!user || user.isAnonymous) {
|
200
|
+
return _authHandle_out(self);
|
211
201
|
}
|
212
|
-
}
|
213
202
|
|
214
|
-
|
215
|
-
// self.log('_authHandle_in', user);
|
216
|
-
// if (self.properties.page.status.didSignUp) {
|
217
|
-
var done;
|
218
|
-
var hoursSinceCreation = Math.abs(new Date() - new Date(+user.metadata.createdAt)) / 36e5;
|
219
|
-
|
220
|
-
function _done() {
|
221
|
-
if (!done) {
|
222
|
-
done = true;
|
223
|
-
store.set('didSignUp', true)
|
224
|
-
_authHandle_in_normal(self, user);
|
225
|
-
}
|
226
|
-
}
|
203
|
+
_authHandle_in_normal(self, user);
|
227
204
|
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
fetch('https://us-central1-' + self.properties.options.libraries.firebase_app.config.projectId + '.cloudfunctions.net/bm_api', {
|
233
|
-
method: 'POST',
|
234
|
-
body: JSON.stringify({
|
235
|
-
authenticationToken: token,
|
236
|
-
command: 'user:sign-up',
|
237
|
-
payload: {
|
238
|
-
newsletterSignUp: select('.auth-newsletter-input').getValue(),
|
239
|
-
// affiliateCode: store.get('auth.affiliateCode', ''),
|
240
|
-
affiliateCode: store.get('affiliateCode', ''),
|
241
|
-
},
|
242
|
-
}),
|
243
|
-
})
|
244
|
-
.catch(function () {})
|
245
|
-
.finally(_done);
|
205
|
+
self.notifications().subscribe().catch(function (e) {
|
206
|
+
console.error(e);
|
207
|
+
});
|
208
|
+
}
|
246
209
|
|
247
|
-
|
248
|
-
|
249
|
-
|
210
|
+
// MOVED TO UJ - 12/15/23
|
211
|
+
// function _authHandle_in(self, user) {
|
212
|
+
// // self.log('_authHandle_in', user);
|
213
|
+
// // if (self.properties.page.status.didSignUp) {
|
214
|
+
// var done;
|
215
|
+
// var hoursSinceCreation = Math.abs(new Date() - new Date(+user.metadata.createdAt)) / 36e5;
|
216
|
+
|
217
|
+
// function _done() {
|
218
|
+
// if (!done) {
|
219
|
+
// done = true;
|
220
|
+
// store.set('didSignUp', true)
|
221
|
+
// _authHandle_in_normal(self, user);
|
222
|
+
// }
|
223
|
+
// }
|
250
224
|
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
225
|
+
// if (!store.get('didSignUp') && hoursSinceCreation < 0.5) {
|
226
|
+
// user.getIdToken(false)
|
227
|
+
// .then(function(token) {
|
228
|
+
|
229
|
+
// fetch('https://us-central1-' + self.properties.options.libraries.firebase_app.config.projectId + '.cloudfunctions.net/bm_api', {
|
230
|
+
// method: 'POST',
|
231
|
+
// body: JSON.stringify({
|
232
|
+
// authenticationToken: token,
|
233
|
+
// command: 'user:sign-up',
|
234
|
+
// payload: {
|
235
|
+
// newsletterSignUp: select('.auth-newsletter-input').getValue(),
|
236
|
+
// // affiliateCode: store.get('auth.affiliateCode', ''),
|
237
|
+
// affiliateCode: store.get('affiliateCode', ''),
|
238
|
+
// },
|
239
|
+
// }),
|
240
|
+
// })
|
241
|
+
// .catch(function () {})
|
242
|
+
// .finally(_done);
|
243
|
+
|
244
|
+
// setTimeout(function () {
|
245
|
+
// _done()
|
246
|
+
// }, 5000);
|
247
|
+
|
248
|
+
// })
|
249
|
+
// .catch(function(error) {
|
250
|
+
// console.error(error);
|
251
|
+
// _done();
|
252
|
+
// });
|
253
|
+
// } else {
|
254
|
+
// _done();
|
255
|
+
// }
|
256
|
+
// }
|
260
257
|
|
261
258
|
|
262
259
|
|
package/package.json
CHANGED