diff --git a/app/ecolyo.5ea001fcb0ec63554d21.js b/app/ecolyo.129cd676002965bb976a.js similarity index 99% rename from app/ecolyo.5ea001fcb0ec63554d21.js rename to app/ecolyo.129cd676002965bb976a.js index 8921e2b492341a977baa20e183c2bfeec2f5a77c..d96754acef55f7cb0ee34d266e76d1d99e7cc416 100644 --- a/app/ecolyo.5ea001fcb0ec63554d21.js +++ b/app/ecolyo.129cd676002965bb976a.js @@ -1984,12 +1984,12 @@ exports.InitStepsErrors = exports.InitSteps = void 0; var InitSteps; exports.InitSteps = InitSteps; (function (InitSteps) { - InitSteps[InitSteps["MIGRATION"] = 0] = "MIGRATION"; - InitSteps[InitSteps["CONSENT"] = 1] = "CONSENT"; + InitSteps[InitSteps["CONSENT"] = 0] = "CONSENT"; + InitSteps[InitSteps["PRICES"] = 1] = "PRICES"; InitSteps[InitSteps["PROFILE"] = 2] = "PROFILE"; - InitSteps[InitSteps["CHALLENGES"] = 3] = "CHALLENGES"; - InitSteps[InitSteps["PRICES"] = 4] = "PRICES"; - InitSteps[InitSteps["CONSOS"] = 5] = "CONSOS"; + InitSteps[InitSteps["CONSOS"] = 3] = "CONSOS"; + InitSteps[InitSteps["MIGRATION"] = 4] = "MIGRATION"; + InitSteps[InitSteps["CHALLENGES"] = 5] = "CHALLENGES"; })(InitSteps || (exports.InitSteps = InitSteps = {})); var InitStepsErrors; exports.InitStepsErrors = InitStepsErrors; @@ -10949,7 +10949,7 @@ var SplashRoot = function SplashRoot(_ref) { } function _loadData() { _loadData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() { - var initializationService, customPopupService, partnersInfoService, ms, startTime, transaction, termsStatus, profile, profileType, profileEcogesture, migrationsResult, _yield$Promise$all, _yield$Promise$all2, duelHash, quizHash, challengeHash, explorationHash, analysisResult, updatedProfile, fluidStatus, lastDataDate, _iterator, _step, fluid, userChallengeList, _filteredCurrentOngoi, _filteredCurrentOngoi2, _filteredCurrentOngoi3, _filteredCurrentDuelC, filteredCurrentOngoingChallenge, actionService, updatedUserChallenge, filteredCurrentDuelChallenge, _yield$initialization, _updatedUserChallenge, dataloads, challengeService, _yield$challengeServi, isDone; + var initializationService, customPopupService, partnersInfoService, ms, startTime, transaction, _yield$Promise$all, _yield$Promise$all2, termsStatus, profile, profileType, profileEcogesture, fluidStatus, migrationsResult, _yield$Promise$all3, _yield$Promise$all4, duelHash, quizHash, challengeHash, explorationHash, analysisResult, updatedProfile, lastDataDate, _iterator, _step, fluid, userChallengeList, _filteredCurrentOngoi, _filteredCurrentOngoi2, _filteredCurrentOngoi3, _filteredCurrentDuelC, filteredCurrentOngoingChallenge, actionService, updatedUserChallenge, filteredCurrentDuelChallenge, _yield$initialization, _updatedUserChallenge, dataloads, challengeService, _yield$challengeServi, isDone; return _regenerator.default.wrap(function _callee7$(_context7) { while (1) { switch (_context7.prev = _context7.next) { @@ -10964,30 +10964,19 @@ var SplashRoot = function SplashRoot(_ref) { }); _context7.prev = 6; _context7.next = 9; - return initializationService.initConsent(); + return Promise.all([initializationService.initConsent(), initializationService.initFluidPrices(), initializationService.initProfile(), initializationService.initProfileType(), initializationService.initProfileEcogesture(), initializationService.initFluidStatus()]); case 9: - termsStatus = _context7.sent; + _yield$Promise$all = _context7.sent; + _yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 6); + termsStatus = _yield$Promise$all2[0]; + profile = _yield$Promise$all2[2]; + profileType = _yield$Promise$all2[3]; + profileEcogesture = _yield$Promise$all2[4]; + fluidStatus = _yield$Promise$all2[5]; if (subscribed) dispatch((0, _global.updateTermsStatus)(termsStatus)); - - // Init fluidPrices - _context7.next = 13; - return initializationService.initFluidPrices(); - case 13: - _context7.next = 15; - return initializationService.initProfile(); - case 15: - profile = _context7.sent; - _context7.next = 18; - return initializationService.initProfileType(); - case 18: - profileType = _context7.sent; - _context7.next = 21; - return initializationService.initProfileEcogesture(); - case 21: - profileEcogesture = _context7.sent; - _context7.next = 24; + _context7.next = 19; return ms.runMigrations(_migration.migrations); - case 24: + case 19: migrationsResult = _context7.sent; // Init last release notes when they exist dispatch((0, _global.showReleaseNotes)({ @@ -10996,20 +10985,20 @@ var SplashRoot = function SplashRoot(_ref) { show: migrationsResult.show })); if (!(subscribed && profile)) { - _context7.next = 45; + _context7.next = 40; break; } setValidExploration(_enums.UserExplorationID.EXPLORATION007); - _context7.next = 30; + _context7.next = 25; return Promise.all([initializationService.initDuelEntity(profile.duelHash), initializationService.initQuizEntity(profile.quizHash), initializationService.initExplorationEntity(profile.challengeHash), initializationService.initChallengeEntity(profile.explorationHash), initializationService.initAnalysis(profile)]); - case 30: - _yield$Promise$all = _context7.sent; - _yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 5); - duelHash = _yield$Promise$all2[0]; - quizHash = _yield$Promise$all2[1]; - challengeHash = _yield$Promise$all2[2]; - explorationHash = _yield$Promise$all2[3]; - analysisResult = _yield$Promise$all2[4]; + case 25: + _yield$Promise$all3 = _context7.sent; + _yield$Promise$all4 = (0, _slicedToArray2.default)(_yield$Promise$all3, 5); + duelHash = _yield$Promise$all4[0]; + quizHash = _yield$Promise$all4[1]; + challengeHash = _yield$Promise$all4[2]; + explorationHash = _yield$Promise$all4[3]; + analysisResult = _yield$Promise$all4[4]; updatedProfile = { duelHash: duelHash, quizHash: quizHash, @@ -11021,21 +11010,18 @@ var SplashRoot = function SplashRoot(_ref) { dispatch((0, _profile.updateProfile)(updatedProfile)); dispatch((0, _analysis.setAnalysisMonth)(analysisResult.monthlyAnalysisDate)); if (!profileType) { - _context7.next = 43; + _context7.next = 38; break; } - _context7.next = 43; + _context7.next = 38; return loadProfileType(profileType); - case 43: + case 38: if (profileEcogesture) { dispatch((0, _profileEcogesture.setProfileEcogesture)(profileEcogesture)); } dispatch((0, _global.toggleAnalysisNotification)(!profile.haveSeenLastAnalysis)); - case 45: - _context7.next = 47; - return initializationService.initFluidStatus(); - case 47: - fluidStatus = _context7.sent; + case 40: + // Process fluids status if (subscribed) { dispatch((0, _global.setFluidStatus)(fluidStatus)); lastDataDate = _luxon.DateTime.fromISO('0001-01-01'); @@ -11054,12 +11040,12 @@ var SplashRoot = function SplashRoot(_ref) { } } // Init Challenge - _context7.next = 51; + _context7.next = 43; return initializationService.initUserChallenges(fluidStatus); - case 51: + case 43: userChallengeList = _context7.sent; if (!subscribed) { - _context7.next = 78; + _context7.next = 70; break; } dispatch((0, _challenge2.setUserChallengeList)(userChallengeList)); @@ -11071,18 +11057,18 @@ var SplashRoot = function SplashRoot(_ref) { } // Set action to notification if action is accomplished if (!(((_filteredCurrentOngoi2 = filteredCurrentOngoingChallenge[0]) === null || _filteredCurrentOngoi2 === void 0 ? void 0 : _filteredCurrentOngoi2.action.state) === _enums.UserActionState.ONGOING)) { - _context7.next = 62; + _context7.next = 54; break; } actionService = new _action.default(client); - _context7.next = 60; + _context7.next = 52; return actionService.isActionDone(filteredCurrentOngoingChallenge[0]); - case 60: + case 52: updatedUserChallenge = _context7.sent; if (updatedUserChallenge) { dispatch((0, _challenge2.updateUserChallengeList)(updatedUserChallenge)); } - case 62: + case 54: // Set Notification if action state is notification if (((_filteredCurrentOngoi3 = filteredCurrentOngoingChallenge[0]) === null || _filteredCurrentOngoi3 === void 0 ? void 0 : _filteredCurrentOngoi3.action.state) === _enums.UserActionState.NOTIFICATION) { dispatch((0, _global.toggleChallengeActionNotification)(true)); @@ -11091,17 +11077,17 @@ var SplashRoot = function SplashRoot(_ref) { return challenge.state === _enums.UserChallengeState.DUEL; }); if (!(((_filteredCurrentDuelC = filteredCurrentDuelChallenge[0]) === null || _filteredCurrentDuelC === void 0 ? void 0 : _filteredCurrentDuelC.duel.state) === _enums.UserDuelState.ONGOING)) { - _context7.next = 78; + _context7.next = 70; break; } - _context7.next = 67; + _context7.next = 59; return initializationService.initDuelProgress(filteredCurrentDuelChallenge[0]); - case 67: + case 59: _yield$initialization = _context7.sent; _updatedUserChallenge = _yield$initialization.updatedUserChallenge; dataloads = _yield$initialization.dataloads; if (!subscribed) { - _context7.next = 78; + _context7.next = 70; break; } dispatch((0, _challenge2.setChallengeConsumption)({ @@ -11110,13 +11096,13 @@ var SplashRoot = function SplashRoot(_ref) { })); // Check is duel is done and display notification challengeService = new _challenge.default(client); - _context7.next = 75; + _context7.next = 67; return challengeService.isChallengeDone(_updatedUserChallenge, dataloads); - case 75: + case 67: _yield$challengeServi = _context7.sent; isDone = _yield$challengeServi.isDone; dispatch((0, _global.toggleChallengeDuelNotification)(isDone)); - case 78: + case 70: /** * Load custom popup and partners info synchronously so these treatments don't block the loading */ @@ -11177,26 +11163,26 @@ var SplashRoot = function SplashRoot(_ref) { }); }); } - _context7.next = 88; + _context7.next = 80; break; - case 83: - _context7.prev = 83; + case 75: + _context7.prev = 75; _context7.t0 = _context7["catch"](6); if (_context7.t0.message === 'Failed to fetch' && !initStepErrors) { setInitStepErrors(_models.InitStepsErrors.UNKNOWN_ERROR); } _logger.default.error("[Initialization] Error : ".concat(_context7.t0)); Sentry.captureException(_context7.t0); - case 88: - _context7.prev = 88; + case 80: + _context7.prev = 80; transaction.finish(); - return _context7.finish(88); - case 91: + return _context7.finish(80); + case 83: case "end": return _context7.stop(); } } - }, _callee7, null, [[6, 83, 88, 91]]); + }, _callee7, null, [[6, 75, 80, 83]]); })); return _loadData.apply(this, arguments); } @@ -26635,13 +26621,14 @@ var InitializationService = /*#__PURE__*/function () { switch (_context4.prev = _context4.next) { case 0: startTime = performance.now(); + this._setInitStep(_models.InitSteps.PRICES); (0, _duration.logDuration)('[Initialization] Launching fluidPrices service', startTime); triggerQuery = (0, _cozyClient.Q)(_doctypes.TRIGGERS_DOCTYPE).where({ 'message.name': 'fluidsPrices' }); - _context4.next = 5; + _context4.next = 6; return this._client.query(triggerQuery); - case 5: + case 6: _yield$this$_client$q = _context4.sent; _yield$this$_client$q2 = (0, _slicedToArray2.default)(_yield$this$_client$q.data, 1); trigger = _yield$this$_client$q2[0]; @@ -26651,7 +26638,7 @@ var InitializationService = /*#__PURE__*/function () { } else { (0, _duration.logDuration)('[Initialization] FluidPrices service trigger not found', startTime); } - case 9: + case 10: case "end": return _context4.stop(); } diff --git a/index.html b/index.html index 6e9f11c44e7ea5e8f91a6b7ea9ad033747f8f089..5ab6141b6a7c8ed01eae45acd882ab7741e2ed42 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.e8036ce80af3e4d9351b.js"></script><script src="app/ecolyo.5ea001fcb0ec63554d21.js"></script></div></body></html> \ No newline at end of file +<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.e8036ce80af3e4d9351b.js"></script><script src="app/ecolyo.129cd676002965bb976a.js"></script></div></body></html> \ No newline at end of file