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
This commit is contained in:
Michel Weststrate
2020-02-11 07:27:00 -08:00
committed by Facebook Github Bot
parent dfcfca4370
commit 182b2a629d

View File

@@ -28,6 +28,7 @@ import {
styled, styled,
Text, Text,
LoadingIndicator, LoadingIndicator,
getPluginKey,
} from 'flipper'; } from 'flipper';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import RatingButton from './RatingButton'; import RatingButton from './RatingButton';
@@ -237,8 +238,17 @@ export default connect<StateFromProps, DispatchFromProps, OwnProps, State>(
launcherMsg, launcherMsg,
share, share,
}, },
connections: {selectedDevice, selectedApp},
pluginStates, pluginStates,
}) => ({ }) => {
const navigationPluginKey = getPluginKey(
selectedApp,
selectedDevice,
'Navigation',
);
const navPluginIsActive = !!pluginStates[navigationPluginKey];
return {
windowIsFocused, windowIsFocused,
leftSidebarVisible, leftSidebarVisible,
rightSidebarVisible, rightSidebarVisible,
@@ -246,10 +256,9 @@ export default connect<StateFromProps, DispatchFromProps, OwnProps, State>(
downloadingImportData, downloadingImportData,
launcherMsg, launcherMsg,
share, share,
navPluginIsActive: Object.keys(pluginStates).some(key => navPluginIsActive,
/#Navigation$/.test(key), };
), },
}),
{ {
setActiveSheet, setActiveSheet,
toggleLeftSidebarVisible, toggleLeftSidebarVisible,