From 68f64e867128d6a42ae023e0644fa44436dc7076 Mon Sep 17 00:00:00 2001 From: Ashish Baravaliya Date: Mon, 19 Feb 2024 20:24:07 -0500 Subject: [PATCH 1/3] fix: At a glance total user metric always displays - --- src/dashboard/Apps/AppsIndex.react.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dashboard/Apps/AppsIndex.react.js b/src/dashboard/Apps/AppsIndex.react.js index 17629e578e..41515ee9f4 100644 --- a/src/dashboard/Apps/AppsIndex.react.js +++ b/src/dashboard/Apps/AppsIndex.react.js @@ -115,15 +115,15 @@ class AppsIndex extends React.Component { } componentWillMount() { + AppsManager.getAllAppsIndexStats().then(() => { + this.forceUpdate(); + }); + document.body.addEventListener('keydown', this.focusField); if (AppsManager.apps().length === 1) { const [app] = AppsManager.apps(); this.props.navigate(`/apps/${app.slug}/browser`); return; } - document.body.addEventListener('keydown', this.focusField); - AppsManager.getAllAppsIndexStats().then(() => { - this.forceUpdate(); - }); } componentWillUnmount() { From 62fdac32a43e9d3b6fca37d78d9fbe1d9582aacf Mon Sep 17 00:00:00 2001 From: Ashish Baravaliya Date: Sun, 25 Feb 2024 19:04:39 -0500 Subject: [PATCH 2/3] fix: removed the redirection code for single app --- src/dashboard/Apps/AppsIndex.react.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/dashboard/Apps/AppsIndex.react.js b/src/dashboard/Apps/AppsIndex.react.js index 41515ee9f4..054f1190eb 100644 --- a/src/dashboard/Apps/AppsIndex.react.js +++ b/src/dashboard/Apps/AppsIndex.react.js @@ -119,11 +119,6 @@ class AppsIndex extends React.Component { this.forceUpdate(); }); document.body.addEventListener('keydown', this.focusField); - if (AppsManager.apps().length === 1) { - const [app] = AppsManager.apps(); - this.props.navigate(`/apps/${app.slug}/browser`); - return; - } } componentWillUnmount() { From 3e0087285950e63d7cb3535a1ba1a8a9ce7d45e1 Mon Sep 17 00:00:00 2001 From: Ashish Baravaliya Date: Sun, 25 Feb 2024 19:06:40 -0500 Subject: [PATCH 3/3] refactor: minor line change --- src/dashboard/Apps/AppsIndex.react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dashboard/Apps/AppsIndex.react.js b/src/dashboard/Apps/AppsIndex.react.js index 054f1190eb..51321ca135 100644 --- a/src/dashboard/Apps/AppsIndex.react.js +++ b/src/dashboard/Apps/AppsIndex.react.js @@ -115,10 +115,10 @@ class AppsIndex extends React.Component { } componentWillMount() { + document.body.addEventListener('keydown', this.focusField); AppsManager.getAllAppsIndexStats().then(() => { this.forceUpdate(); }); - document.body.addEventListener('keydown', this.focusField); } componentWillUnmount() {