Move supportform related redux property in a different reducer

Summary: This diff moves support form related redux prop to a separate reducer under separate supportForm property.

Reviewed By: passy

Differential Revision: D18272436

fbshipit-source-id: b64c4e041d8dacd305a71db255752a310a46b0d1
This commit is contained in:
Pritesh Nandgaonkar
2019-11-04 03:57:23 -08:00
committed by Facebook Github Bot
parent 9ec4ef67ad
commit 7c69aba8fa
3 changed files with 53 additions and 21 deletions

View File

@@ -66,10 +66,6 @@ export type ShareType = {
closeOnFinish: boolean;
} & SubShareType;
export type NTUsersFormData = {
flipper_trace: string | null;
};
export type State = {
leftSidebarVisible: boolean;
rightSidebarVisible: boolean;
@@ -84,7 +80,6 @@ export type State = {
flipperRating: number | null;
statusMessages: Array<string>;
xcodeCommandLineToolsDetected: boolean;
supportForm: {webState: NTUsersFormData} | null;
};
type BooleanActionType =
@@ -155,12 +150,6 @@ export type Action =
payload: {
isDetected: boolean;
};
}
| {
type: 'SET_SUPPORT_FORM_STATE';
payload: {
webState: NTUsersFormData;
} | null;
};
export const initialState: () => State = () => ({
@@ -183,7 +172,6 @@ export const initialState: () => State = () => ({
flipperRating: null,
statusMessages: [],
xcodeCommandLineToolsDetected: false,
supportForm: null,
});
function statusMessage(sender: string, msg: string): string {
@@ -297,8 +285,6 @@ export default function reducer(
return state;
} else if (action.type === 'SET_XCODE_DETECTED') {
return {...state, xcodeCommandLineToolsDetected: action.payload.isDetected};
} else if (action.type === 'SET_SUPPORT_FORM_STATE') {
return {...state, supportForm: action.payload};
} else {
return state;
}
@@ -384,10 +370,3 @@ export const setXcodeDetected = (isDetected: boolean): Action => ({
type: 'SET_XCODE_DETECTED',
payload: {isDetected},
});
export const setSupportFormState = (
payload: {webState: NTUsersFormData} | null,
): Action => ({
type: 'SET_SUPPORT_FORM_STATE',
payload,
});