Show support form option for deeplink users
Summary: This diff shows the support form option for the deeplink users too even if they are not part of GK. As I discovered a bug where the user opened the Flipper app thru deeplink and then the screen showed temporarily till the device connected and then the default plugin was displayed. In this case there is no way to navigate back to the form. Reviewed By: jknoxville Differential Revision: D17978648 fbshipit-source-id: 23ae3660e499a959733753b49cc987f2e381bf6b
This commit is contained in:
committed by
Facebook Github Bot
parent
781344f7de
commit
65ff3f8ec9
@@ -245,7 +245,22 @@ type DispatchFromProps = {
|
||||
};
|
||||
|
||||
type Props = OwnProps & StateFromProps & DispatchFromProps;
|
||||
class MainSidebar extends PureComponent<Props> {
|
||||
type State = {showSupportForm: boolean};
|
||||
class MainSidebar extends PureComponent<Props, State> {
|
||||
state: State = {showSupportForm: GK.get('flipper_support_requests')};
|
||||
static getDerivedStateFromProps(props: Props, state: State) {
|
||||
if (
|
||||
!state.showSupportForm &&
|
||||
props.staticView === SupportRequestFormManager
|
||||
) {
|
||||
// Show SupportForm option even when GK is false and support form is shown.
|
||||
// That means the user has used deeplink to open support form.
|
||||
// Once the variable is true, it will be true for the whole session.
|
||||
return {showSupportForm: true};
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
selectedDevice,
|
||||
@@ -304,7 +319,7 @@ class MainSidebar extends PureComponent<Props> {
|
||||
</PluginName>
|
||||
</ListItem>
|
||||
)}
|
||||
{GK.get('flipper_support_requests') && (
|
||||
{this.state.showSupportForm && (
|
||||
<ListItem
|
||||
active={
|
||||
staticView != null && staticView === SupportRequestFormManager
|
||||
|
||||
Reference in New Issue
Block a user