From 8e88aa55e1e7740b08c856870902a12af7fcfe62 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Tue, 7 May 2024 14:10:00 +0530 Subject: [PATCH] #1328 - fix for secondary dashboard getting selected on menu select --- packages/openchs-android/src/action/LandingViewActions.js | 4 ++++ packages/openchs-android/src/views/LandingView.js | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/openchs-android/src/action/LandingViewActions.js b/packages/openchs-android/src/action/LandingViewActions.js index b21357230..c2033c22a 100644 --- a/packages/openchs-android/src/action/LandingViewActions.js +++ b/packages/openchs-android/src/action/LandingViewActions.js @@ -54,6 +54,7 @@ class LandingViewActions { return { ...newState, home: true, + secondaryDashboardSelected: false } } @@ -62,6 +63,7 @@ class LandingViewActions { return { ...newState, search: true, + secondaryDashboardSelected: false } } @@ -78,6 +80,7 @@ class LandingViewActions { return { ...newState, register: true, + secondaryDashboardSelected: false } } @@ -86,6 +89,7 @@ class LandingViewActions { return { ...newState, menu: true, + secondaryDashboardSelected: false } } diff --git a/packages/openchs-android/src/views/LandingView.js b/packages/openchs-android/src/views/LandingView.js index cccc040b8..42a5f7c81 100644 --- a/packages/openchs-android/src/views/LandingView.js +++ b/packages/openchs-android/src/views/LandingView.js @@ -146,9 +146,10 @@ class LandingView extends AbstractComponent { registerMenuItem, searchMenuItem ]; - if (!_.isNil(secondaryDashboard)) + if (!_.isNil(secondaryDashboard)) { bottomBarIcons.push([this.Icon("dashboard", LandingView.barIconStyle, secondaryDashboardSelected, false, "MaterialIcons"), - _.truncate(this.I18n.t(secondaryDashboard.name), {'length': 14}), () => this.dispatchAction(Actions.ON_SECONDARY_DASHBOARD_CLICK), menu]); + _.truncate(this.I18n.t(secondaryDashboard.name), {'length': 14}), () => this.dispatchAction(Actions.ON_SECONDARY_DASHBOARD_CLICK), secondaryDashboardSelected]); + } bottomBarIcons.push(moreMenu); return (