From cbb7e8cbcf020e79a59e2bc302882c798ccf8a8b Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 4 Jan 2023 12:14:03 +0100 Subject: [PATCH] (bug) unable to return to the statistics tab --- CHANGELOG.md | 1 + app/frontend/src/javascript/controllers/admin/statistics.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 147f386da..d67af6f9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ - Fix a bug: low stock notification is always sent if one of the stocks has reached the threshold - Fix a bug: unable to update title of availability after admin remove a machine/plan in calendar - Fix a bug: unable to access files from the public folder (like example.csv) +- Fix a bug: unable to return to the statistics tab - Updated react-modal to 3.16.1 - Updated tiptap editor and its dependencies to 2.0.0-beta.204 - [TODO DEPLOY] `rails db:seed` diff --git a/app/frontend/src/javascript/controllers/admin/statistics.js b/app/frontend/src/javascript/controllers/admin/statistics.js index cf84ce794..bce3a669a 100644 --- a/app/frontend/src/javascript/controllers/admin/statistics.js +++ b/app/frontend/src/javascript/controllers/admin/statistics.js @@ -410,7 +410,7 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', // workaround for angular-bootstrap::tabs behavior: on tab deletion, another tab will be selected // which will cause every tabs to reload, one by one, when the view is closed $transitions.onStart({ to: 'app.admin.statistics' }, function (trans) { - if (Object.keys(trans.from().params).length === 0) { + if (Object.keys(trans.from().params || {}).length === 0) { return $scope.preventRefresh = true; } });