Skip to content

Commit

Permalink
remove more code
Browse files Browse the repository at this point in the history
  • Loading branch information
parkiino committed Jun 12, 2020
1 parent 51f47f2 commit d9069b9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,10 @@ interface ServerFailedToReturnHostPolicyResponse {
payload: ServerApiError;
}

interface ServerReturnedEndpointPackageVersion {
type: 'serverReturnedEndpointPackageVersion';
payload: string;
}

interface ServerFailedToReturnEndpointPackageVersion {
type: 'serverFailedToReturnEndpointPackageVersion';
payload: ServerApiError;
}

export type HostAction =
| ServerReturnedHostList
| ServerFailedToReturnHostList
| ServerReturnedHostDetails
| ServerFailedToReturnHostDetails
| ServerReturnedHostPolicyResponse
| ServerFailedToReturnHostPolicyResponse
| ServerReturnedEndpointPackageVersion
| ServerFailedToReturnEndpointPackageVersion;
| ServerFailedToReturnHostPolicyResponse;
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export const initialHostListState: Immutable<HostState> = {
policyResponse: undefined,
policyResponseLoading: false,
policyResponseError: undefined,
endpointPackageVersion: undefined,
endpointPackageVersionError: undefined,
location: undefined,
};

Expand Down Expand Up @@ -80,18 +78,6 @@ export const hostListReducer: ImmutableReducer<HostState, AppAction> = (
policyResponseError: action.payload,
policyResponseLoading: false,
};
} else if (action.type === 'serverReturnedEndpointPackageVersion') {
return {
...state,
endpointPackageVersion: action.payload,
endpointPackageVersionError: undefined,
};
} else if (action.type === 'serverFailedToReturnEndpointPackageVersion') {
return {
...state,
endpointPackageError: action.payload,
endpointPackageVersion: undefined,
};
} else if (action.type === 'userChangedUrl') {
const newState: Immutable<HostState> = {
...state,
Expand All @@ -111,7 +97,6 @@ export const hostListReducer: ImmutableReducer<HostState, AppAction> = (
loading: true,
error: undefined,
detailsError: undefined,
endpointVersionError: undefined,
};
}
} else if (isCurrentlyOnDetailsPage) {
Expand All @@ -125,7 +110,6 @@ export const hostListReducer: ImmutableReducer<HostState, AppAction> = (
error: undefined,
detailsError: undefined,
policyResponseError: undefined,
endpointVersionError: undefined,
};
} else {
// if previous page was not host list or host details, load both list and details
Expand All @@ -138,7 +122,6 @@ export const hostListReducer: ImmutableReducer<HostState, AppAction> = (
error: undefined,
detailsError: undefined,
policyResponseError: undefined,
endpointVersionError: undefined,
};
}
}
Expand All @@ -149,7 +132,6 @@ export const hostListReducer: ImmutableReducer<HostState, AppAction> = (
error: undefined,
detailsError: undefined,
policyResponseError: undefined,
endpointVersionError: undefined,
};
}
return state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ export interface HostState {
policyResponseLoading: boolean;
/** api error from retrieving the policy response */
policyResponseError?: ServerApiError;
/** latest endpoint package version */
endpointPackageVersion?: string;
/** api error from retrieving endpoint package version */
endpointPackageVersionError?: ServerApiError;
/** current location info */
location?: Immutable<AppLocation>;
}
Expand Down

0 comments on commit d9069b9

Please sign in to comment.