From 182b2a629dd9fb18af27831388bee17639e60b49 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Tue, 11 Feb 2020 07:27:00 -0800 Subject: [PATCH] Fixed bug where location bar remained active but empty on apps / devices that don't have nav Summary: Fixed bug where location bar remained active but empty on apps / devices that don't have nav Reviewed By: nikoant Differential Revision: D19788337 fbshipit-source-id: c5f7299945783672164ed03d487a023ddaadc082 --- src/chrome/TitleBar.tsx | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/chrome/TitleBar.tsx b/src/chrome/TitleBar.tsx index 03fa2a625..27c43f23c 100644 --- a/src/chrome/TitleBar.tsx +++ b/src/chrome/TitleBar.tsx @@ -28,6 +28,7 @@ import { styled, Text, LoadingIndicator, + getPluginKey, } from 'flipper'; import {connect} from 'react-redux'; import RatingButton from './RatingButton'; @@ -237,19 +238,27 @@ export default connect( launcherMsg, share, }, + connections: {selectedDevice, selectedApp}, pluginStates, - }) => ({ - windowIsFocused, - leftSidebarVisible, - rightSidebarVisible, - rightSidebarAvailable, - downloadingImportData, - launcherMsg, - share, - navPluginIsActive: Object.keys(pluginStates).some(key => - /#Navigation$/.test(key), - ), - }), + }) => { + const navigationPluginKey = getPluginKey( + selectedApp, + selectedDevice, + 'Navigation', + ); + const navPluginIsActive = !!pluginStates[navigationPluginKey]; + + return { + windowIsFocused, + leftSidebarVisible, + rightSidebarVisible, + rightSidebarAvailable, + downloadingImportData, + launcherMsg, + share, + navPluginIsActive, + }; + }, { setActiveSheet, toggleLeftSidebarVisible,