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,19 +238,27 @@ export default connect<StateFromProps, DispatchFromProps, OwnProps, State>(
launcherMsg, launcherMsg,
share, share,
}, },
connections: {selectedDevice, selectedApp},
pluginStates, pluginStates,
}) => ({ }) => {
windowIsFocused, const navigationPluginKey = getPluginKey(
leftSidebarVisible, selectedApp,
rightSidebarVisible, selectedDevice,
rightSidebarAvailable, 'Navigation',
downloadingImportData, );
launcherMsg, const navPluginIsActive = !!pluginStates[navigationPluginKey];
share,
navPluginIsActive: Object.keys(pluginStates).some(key => return {
/#Navigation$/.test(key), windowIsFocused,
), leftSidebarVisible,
}), rightSidebarVisible,
rightSidebarAvailable,
downloadingImportData,
launcherMsg,
share,
navPluginIsActive,
};
},
{ {
setActiveSheet, setActiveSheet,
toggleLeftSidebarVisible, toggleLeftSidebarVisible,