From ce67b1426edd54b6b5ef894a21da5fbae141346a Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 12 Aug 2020 07:23:33 +0200 Subject: [PATCH] Fixed: Reload content after data was deleted (#74) --- core/state-manager.js | 3 +++ pages/statistics/statistics.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/state-manager.js b/core/state-manager.js index 574a23e1..14139ae3 100644 --- a/core/state-manager.js +++ b/core/state-manager.js @@ -221,6 +221,9 @@ stateManager._handleStorageChanged = function (changes) { if (Setting.INTERNAL_STATISTICS in changes) { stateManager.internalStatistics = changes.internalStatistics.newValue; } + if (Setting.INTERNAL_STATISTICS_DATA in changes) { + stats.data = changes.internalStatisticsData.newValue; + } }; stateManager._clearBadgeText = function (tabIdentifier) { diff --git a/pages/statistics/statistics.js b/pages/statistics/statistics.js index 33f7dfac..f1dfb84e 100644 --- a/pages/statistics/statistics.js +++ b/pages/statistics/statistics.js @@ -208,10 +208,10 @@ statistics._handlerDateRange = function ({ target }) { let type = target.value; if (type === 'day' || type === 'week' || type === 'month' || type === 'year') { statistics._dateUnit = type; - statistics._getStatistics().then(statistics._setDateRange); } else if (type === 'delete') { statistics._deleteStatistic(); } + statistics._getStatistics().then(statistics._setDateRange); }; statistics._deleteStatistic = function () {