diff --git a/3/ecolyo.5232c0302b729ee24df1.js b/3/ecolyo.4fdcb53af560576def95.js similarity index 99% rename from 3/ecolyo.5232c0302b729ee24df1.js rename to 3/ecolyo.4fdcb53af560576def95.js index 9eaf1d4f9c62c343ede1424f4c2953a1b0041936..cc100d37e92d99cc7e6b69ca20707bd7dd59cc60 100644 --- a/3/ecolyo.5232c0302b729ee24df1.js +++ b/3/ecolyo.4fdcb53af560576def95.js @@ -119,23 +119,17 @@ var ElecHalfHourMonthlyAnalysis = function ElecHalfHourMonthlyAnalysis(_ref) { return cs.checkDoctypeEntries(_enums.FluidType.ELECTRICITY, _enums.TimeStep.HALF_AN_HOUR); case 3: isHalfHourLoadActivated = _context.sent; - if (subscribed) { - _context.next = 6; - break; - } - return _context.abrupt("return"); - case 6: if (!isHalfHourLoadActivated) { - _context.next = 13; + _context.next = 11; break; } setIsHalfHourActivated(true); aggregatedDate = analysisMonth.minus({ month: 1 }); - _context.next = 11; + _context.next = 9; return emas.getEnedisMonthlyAnalysisByDate(aggregatedDate.year, aggregatedDate.month); - case 11: + case 9: data = _context.sent; if (data !== null && data !== void 0 && data.length) { aggregatedData = emas.aggregateValuesToDataLoad(data[0]); @@ -146,9 +140,9 @@ var ElecHalfHourMonthlyAnalysis = function ElecHalfHourMonthlyAnalysis(_ref) { setFacturePercentage(percentage); } } - case 13: + case 11: setIsLoading(false); - case 14: + case 12: case "end": return _context.stop(); } @@ -157,7 +151,7 @@ var ElecHalfHourMonthlyAnalysis = function ElecHalfHourMonthlyAnalysis(_ref) { })); return _fetchEnedisAnalysisData.apply(this, arguments); } - fetchEnedisAnalysisData(); + subscribed && fetchEnedisAnalysisData(); return function () { subscribed = false; }; @@ -181,7 +175,7 @@ var ElecHalfHourMonthlyAnalysis = function ElecHalfHourMonthlyAnalysis(_ref) { })); case 2: price = _context2.sent; - if (subscribed && price) { + if (price) { setElecPrice(price); } case 4: @@ -193,7 +187,7 @@ var ElecHalfHourMonthlyAnalysis = function ElecHalfHourMonthlyAnalysis(_ref) { })); return _getAllLastPrices.apply(this, arguments); } - getAllLastPrices(); + subscribed && getAllLastPrices(); return function () { subscribed = false; }; @@ -205,23 +199,19 @@ var ElecHalfHourMonthlyAnalysis = function ElecHalfHourMonthlyAnalysis(_ref) { } function _getOffPeakHours() { _getOffPeakHours = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() { - var _offPeakHours; + var offPeakHours; return _regenerator.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: - if (!subscribed) { - _context3.next = 5; - break; - } - _context3.next = 3; + _context3.next = 2; return emas.getOffPeakHours(); - case 3: - _offPeakHours = _context3.sent; - if (_offPeakHours) { - setOffPeakHours(_offPeakHours); + case 2: + offPeakHours = _context3.sent; + if (offPeakHours) { + setOffPeakHours(offPeakHours); } - case 5: + case 4: case "end": return _context3.stop(); } @@ -230,7 +220,7 @@ var ElecHalfHourMonthlyAnalysis = function ElecHalfHourMonthlyAnalysis(_ref) { })); return _getOffPeakHours.apply(this, arguments); } - getOffPeakHours(); + subscribed && getOffPeakHours(); return function () { subscribed = false; }; @@ -1078,13 +1068,9 @@ var Comparison = function Comparison(_ref) { while (1) { switch (_context.prev = _context.next) { case 0: - if (!subscribed) { - _context.next = 6; - break; - } - _context.next = 3; + _context.next = 2; return consumptionService.getPerformanceIndicators(periods.monthPeriod, _enums.TimeStep.MONTH, fluidsWithData, periods.previousYearPeriod); - case 3: + case 2: fetchedYearIndicators = _context.sent; if (fetchedYearIndicators) { setYearPerformanceIndicators(fetchedYearIndicators); @@ -1095,7 +1081,7 @@ var Comparison = function Comparison(_ref) { } } setIsLoading(false); - case 6: + case 5: case "end": return _context.stop(); } @@ -1104,7 +1090,7 @@ var Comparison = function Comparison(_ref) { })); return _populateData.apply(this, arguments); } - populateData(); + subscribed && populateData(); return function () { subscribed = false; }; @@ -1351,9 +1337,7 @@ var TotalAnalysisChart = function TotalAnalysisChart(_ref) { })); return _getTotalData.apply(this, arguments); } - if (subscribed) { - getTotalData(); - } + subscribed && getTotalData(); return function () { subscribed = false; }; @@ -1682,9 +1666,7 @@ var MaxConsumptionCard = function MaxConsumptionCard(_ref) { })); return _getMaxLoadData.apply(this, arguments); } - if (subscribed) { - getMaxLoadData(); - } + subscribed && getMaxLoadData(); return function () { subscribed = false; }; @@ -2284,9 +2266,7 @@ var MonthlyAnalysis = function MonthlyAnalysis(_ref) { return _ref2.apply(this, arguments); }; }(); - if (subscribed) { - populateData(); - } + subscribed && populateData(); return function () { saveLastScrollPosition(); subscribed = false; @@ -2691,7 +2671,7 @@ var ProfileComparator = function ProfileComparator(_ref) { case 4: profileType = _context.sent; if (!(profileType !== null)) { - _context.next = 11; + _context.next = 13; break; } profileTypeService = new _profileType.default(profileType, client, analysisMonth.minus({ @@ -2701,14 +2681,12 @@ var ProfileComparator = function ProfileComparator(_ref) { return profileTypeService.getMonthlyForecast(analysisDate.year, analysisDate.month); case 9: monthlyForecast = _context.sent; - if (subscribed) { - setForecast(monthlyForecast); - if (monthlyForecast) { - getTotalValueWithConnectedFluids(monthlyForecast); - } - setIsLoading(false); + setForecast(monthlyForecast); + if (monthlyForecast) { + getTotalValueWithConnectedFluids(monthlyForecast); } - case 11: + setIsLoading(false); + case 13: case "end": return _context.stop(); } @@ -2717,7 +2695,7 @@ var ProfileComparator = function ProfileComparator(_ref) { })); return _loadAverageConsumption.apply(this, arguments); } - loadAverageConsumption(); + subscribed && loadAverageConsumption(); return function () { subscribed = false; }; diff --git a/4/ecolyo.279a6a7993cecc6af309.js b/4/ecolyo.33628861e9b4596e92a2.js similarity index 99% rename from 4/ecolyo.279a6a7993cecc6af309.js rename to 4/ecolyo.33628861e9b4596e92a2.js index 9235afe800f6a6cda6c4291ea0cd6099d2f629a7..70591c9f829ee2b605d12d42e0f1759d73d34964 100644 --- a/4/ecolyo.279a6a7993cecc6af309.js +++ b/4/ecolyo.33628861e9b4596e92a2.js @@ -2419,7 +2419,7 @@ var FluidChartSlide = function FluidChartSlide(_ref) { while (1) { switch (_context.prev = _context.next) { case 0: - if (currentTimeStep != timeStep && subscribed) { + if (currentTimeStep != timeStep) { setIsDataLoaded(false); setTimeStep(currentTimeStep); } @@ -2452,7 +2452,7 @@ var FluidChartSlide = function FluidChartSlide(_ref) { }); case 15: graphData = _context.sent; - if (subscribed && graphData && (graphData === null || graphData === void 0 ? void 0 : graphData.actualData.length) > 0) { + if (graphData && (graphData === null || graphData === void 0 ? void 0 : graphData.actualData.length) > 0) { setChartData(graphData); setIsDataLoaded(true); } @@ -2465,7 +2465,7 @@ var FluidChartSlide = function FluidChartSlide(_ref) { })); return _loadData.apply(this, arguments); } - loadData(); + subscribed && loadData(); return function () { subscribed = false; }; @@ -5079,7 +5079,7 @@ var ConsumptionView = function ConsumptionView(_ref) { } finally { _iterator.f(); } - if (subscribed) setConsentExpiredFluids(expiredConsents); + subscribed && setConsentExpiredFluids(expiredConsents); return function () { subscribed = false; }; @@ -5581,7 +5581,7 @@ var TotalConsumption = function TotalConsumption(_ref) { }; }(), [client, currentTimeStep, fluidType]); (0, _react.useEffect)(function () { - var isMounted = true; + var subscribed = true; var fetchTotal = /*#__PURE__*/function () { var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() { return _regenerator.default.wrap(function _callee2$(_context2) { @@ -5608,9 +5608,9 @@ var TotalConsumption = function TotalConsumption(_ref) { return _ref3.apply(this, arguments); }; }(); - isMounted && fetchTotal(); + subscribed && fetchTotal(); return function () { - isMounted = false; + subscribed = false; }; }, [currentDatachart, fluidType, currentTimeStep, client, computeTotal]); var compareIcon = function compareIcon() { diff --git a/6/ecolyo.842989f6006a806e3457.js b/6/ecolyo.d1ae731e63a56e0cce3f.js similarity index 99% rename from 6/ecolyo.842989f6006a806e3457.js rename to 6/ecolyo.d1ae731e63a56e0cce3f.js index 80334a218b52bc386d78aa7e5741073078794861..99ae0bc9146781953505b771cbc6341adeda84f5 100644 --- a/6/ecolyo.842989f6006a806e3457.js +++ b/6/ecolyo.d1ae731e63a56e0cce3f.js @@ -1097,9 +1097,7 @@ var ReportOptions = function ReportOptions() { })); return _getMaxLoadData.apply(this, arguments); } - if (subscribed) { - getMaxLoadData(); - } + subscribed && getMaxLoadData(); return function () { subscribed = false; }; @@ -1539,9 +1537,7 @@ var ExportData = function ExportData() { return _ref.apply(this, arguments); }; }(); - if (subscribed) { - getExportableFluids(); - } + subscribed && getExportableFluids(); return function () { subscribed = false; }; diff --git a/7/ecolyo.62d0f8799ccda737a9e5.js b/7/ecolyo.1e90cb873be450d05a56.js similarity index 99% rename from 7/ecolyo.62d0f8799ccda737a9e5.js rename to 7/ecolyo.1e90cb873be450d05a56.js index 887a4a04296a277d70a1e4e0410d1ab7e5b38afa..90341943d67e2df667dbfafe88d8ca4234192196 100644 --- a/7/ecolyo.62d0f8799ccda737a9e5.js +++ b/7/ecolyo.1e90cb873be450d05a56.js @@ -80,7 +80,7 @@ var EstimatedConsumptionModal = function EstimatedConsumptionModal(_ref) { return fluidsPricesService.getAllLastPrices(); case 2: prices = _context.sent; - if (subscribed && prices) { + if (prices) { setPrices(prices); } case 4: @@ -92,7 +92,7 @@ var EstimatedConsumptionModal = function EstimatedConsumptionModal(_ref) { })); return _getAllLastPrices.apply(this, arguments); } - getAllLastPrices(); + subscribed && getAllLastPrices(); return function () { subscribed = false; }; diff --git a/8/ecolyo.622a8b7f33699fb0288b.js b/8/ecolyo.42acbbc92a4cf3e13c3e.js similarity index 97% rename from 8/ecolyo.622a8b7f33699fb0288b.js rename to 8/ecolyo.42acbbc92a4cf3e13c3e.js index 2a31e9cc3072c9c389e9d877ff71631d3dc03775..42e015227c6129886989ba7db529fa671cd6761c 100644 --- a/8/ecolyo.622a8b7f33699fb0288b.js +++ b/8/ecolyo.42acbbc92a4cf3e13c3e.js @@ -192,25 +192,19 @@ var SingleEcogestureView = function SingleEcogestureView() { return ecogestureService.getEcogesturesByIds([ecogestureID || '']); case 2: data = _context2.sent; - if (!subscribed) { - _context2.next = 15; - break; - } if (!(data !== null && data !== void 0 && data[0])) { _context2.next = 12; break; } setEcogesture(data[0]); // Prevent case this key doesn't exist in doctype - _context2.next = 8; + _context2.next = 7; return (0, _utils.importIconById)(data[0].id, 'ecogesture'); - case 8: + case 7: icon = _context2.sent; - if (subscribed) { - setEcogestureIcon(icon || _default2.default); - if ((currentChallenge === null || currentChallenge === void 0 ? void 0 : currentChallenge.exploration.ecogesture_id) === data[0]._id) { - setValidExploration(currentChallenge.exploration.id); - } + setEcogestureIcon(icon || _default2.default); + if ((currentChallenge === null || currentChallenge === void 0 ? void 0 : currentChallenge.exploration.ecogesture_id) === data[0]._id) { + setValidExploration(currentChallenge.exploration.id); } _context2.next = 14; break; @@ -228,7 +222,7 @@ var SingleEcogestureView = function SingleEcogestureView() { })); return _getSingleEcogesture.apply(this, arguments); } - getSingleEcogesture(); + subscribed && getSingleEcogesture(); return function () { subscribed = false; }; diff --git a/app/ecolyo.a9eeee34e942413566a1.js b/app/ecolyo.5d6bbc74e14b77482505.js similarity index 99% rename from app/ecolyo.a9eeee34e942413566a1.js rename to app/ecolyo.5d6bbc74e14b77482505.js index b4fc29456e8a3878a6343a59e59740a71f84f7e9..fd2d0eaf113dad1e087299893314b4ab0464b33c 100644 --- a/app/ecolyo.a9eeee34e942413566a1.js +++ b/app/ecolyo.5d6bbc74e14b77482505.js @@ -64,7 +64,7 @@ /******/ /******/ // script path function /******/ function jsonpScriptSrc(chunkId) { -/******/ return __webpack_require__.p + "" + ({}[chunkId]||chunkId) + "/ecolyo." + {"3":"5232c0302b729ee24df1","4":"279a6a7993cecc6af309","5":"c8ff0c6c70d106accae3","6":"842989f6006a806e3457","7":"62d0f8799ccda737a9e5","8":"622a8b7f33699fb0288b","9":"f45e19d3c34ba67e355b","10":"fe3625578fa387c11975","11":"346fcb0fa7b2e3565ad3"}[chunkId] + ".js" +/******/ return __webpack_require__.p + "" + ({}[chunkId]||chunkId) + "/ecolyo." + {"3":"4fdcb53af560576def95","4":"33628861e9b4596e92a2","5":"c8ff0c6c70d106accae3","6":"d1ae731e63a56e0cce3f","7":"1e90cb873be450d05a56","8":"42acbbc92a4cf3e13c3e","9":"f45e19d3c34ba67e355b","10":"fe3625578fa387c11975","11":"346fcb0fa7b2e3565ad3"}[chunkId] + ".js" /******/ } /******/ /******/ // The require function @@ -2225,9 +2225,7 @@ var ChallengeCardOnGoing = function ChallengeCardOnGoing(_ref) { switch (_context3.prev = _context3.next) { case 0: (0, _utils.importIconById)(userChallenge.id, 'challenge').then(function (icon) { - if (subscribed) { - icon ? setChallengeIcon(icon) : setChallengeIcon(_CHALLENGE.default); - } + icon ? setChallengeIcon(icon) : setChallengeIcon(_CHALLENGE.default); }); case 1: case "end": @@ -2238,7 +2236,7 @@ var ChallengeCardOnGoing = function ChallengeCardOnGoing(_ref) { })); return _importIcon.apply(this, arguments); } - importIcon(); + subscribed && importIcon(); return function () { subscribed = false; }; @@ -2256,9 +2254,7 @@ var ChallengeCardOnGoing = function ChallengeCardOnGoing(_ref) { switch (_context5.prev = _context5.next) { case 0: isChallengeDone = challengeService.isChallengeDone(userChallenge, currentDataload); - if (subscribed) { - setIsDone(isChallengeDone.isDone); - } + setIsDone(isChallengeDone.isDone); case 2: case "end": return _context5.stop(); @@ -2301,7 +2297,7 @@ var ChallengeCardOnGoing = function ChallengeCardOnGoing(_ref) { }; }(); unlockDuel(); - setChallengeResult(); + subscribed && setChallengeResult(); return function () { subscribed = false; }; @@ -2771,9 +2767,7 @@ var QuizQuestion = function QuizQuestion(_ref) { return quizService.getCustomQuestion(userChallenge.quiz.customQuestion, fluidTypes); case 3: customQuestion = _context.sent; - if (subscribed) { - setCustomQuestion(customQuestion); - } + setCustomQuestion(customQuestion); case 5: case "end": return _context.stop(); @@ -2783,7 +2777,7 @@ var QuizQuestion = function QuizQuestion(_ref) { })); return _loadCustomQuestion.apply(this, arguments); } - if (isCustomQuest) { + if (isCustomQuest && subscribed) { loadCustomQuestion(); } return function () { @@ -7179,17 +7173,15 @@ var EcogestureSelectionView = function EcogestureSelectionView() { return ecogesture.viewedInSelection === false; }); slicedFilteredList = filteredList.slice(0, 10); - if (subscribed) { - if (availableList.length === slicedFilteredList.length && slicedFilteredList.length > 0) { - setOpenEcSelectionModal(true); - } - setTotalAvailable(availableList.length); - setTotalViewed(availableList.length - filteredList.length); - setEcogestureList(slicedFilteredList); - setIndexEcogesture(0); - setIsLoading(false); + if (availableList.length === slicedFilteredList.length && slicedFilteredList.length > 0) { + setOpenEcSelectionModal(true); } - case 7: + setTotalAvailable(availableList.length); + setTotalViewed(availableList.length - filteredList.length); + setEcogestureList(slicedFilteredList); + setIndexEcogesture(0); + setIsLoading(false); + case 12: case "end": return _context3.stop(); } @@ -7198,7 +7190,7 @@ var EcogestureSelectionView = function EcogestureSelectionView() { })); return _getFilteredList.apply(this, arguments); } - getFilteredList(); + subscribed && getFilteredList(); return function () { subscribed = false; }; @@ -17348,7 +17340,7 @@ var EquipmentIcon = function EquipmentIcon(_ref) { return (0, _utils.importIconById)(equipment, 'equipments'); case 2: svg = _context.sent; - if (subscribed && svg) { + if (svg) { setIcon(svg); } case 4: @@ -17360,7 +17352,7 @@ var EquipmentIcon = function EquipmentIcon(_ref) { })); return _getIcon.apply(this, arguments); } - getIcon(); + subscribed && getIcon(); return function () { subscribed = false; }; @@ -17950,9 +17942,7 @@ var DuelOngoing = function DuelOngoing(_ref) { return challengeService.getUserChallengeDataload(userChallenge); case 3: dataloads = _context2.sent; - if (subscribed) { - setFinishedDataLoad(dataloads); - } + setFinishedDataLoad(dataloads); case 5: case "end": return _context2.stop(); @@ -17962,7 +17952,7 @@ var DuelOngoing = function DuelOngoing(_ref) { })); return _populateData.apply(this, arguments); } - populateData(); + subscribed && populateData(); return function () { subscribed = false; }; @@ -19321,9 +19311,7 @@ var ActionList = function ActionList(_ref) { case 10: actionList = _context.sent; case 11: - if (subscribed) { - setActions(actionList); - } + setActions(actionList); case 12: case "end": return _context.stop(); @@ -19335,7 +19323,7 @@ var ActionList = function ActionList(_ref) { return _ref2.apply(this, arguments); }; }(); - getActions(); + subscribed && getActions(); return function () { subscribed = false; }; @@ -31180,9 +31168,7 @@ var EcogestureSelectionDetail = function EcogestureSelectionDetail(_ref) { return (0, _utils.importIconById)(ecogesture.id, 'ecogesture'); case 2: icon = _context.sent; - if (subscribed) { - setEcogestureIcon(icon || _default2.default); - } + setEcogestureIcon(icon || _default2.default); case 4: case "end": return _context.stop(); @@ -31192,7 +31178,7 @@ var EcogestureSelectionDetail = function EcogestureSelectionDetail(_ref) { })); return _getIcon.apply(this, arguments); } - getIcon(); + subscribed && getIcon(); setShowDetails(false); return function () { subscribed = false; diff --git a/index.html b/index.html index 8e7afa6f387cb7e781adfa0063c9a1572cf2443c..7ea7742143b38378a60f9bc2a6a7e52d06dc9be1 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.9cebad5ae7ea932ed345.js"></script><script src="app/ecolyo.a9eeee34e942413566a1.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.9cebad5ae7ea932ed345.js"></script><script src="app/ecolyo.5d6bbc74e14b77482505.js"></script></div></body></html> \ No newline at end of file