Fix endpoints to use locally available (#2274)

* Fix endpoints to use locally available

* Revert endpoint test changes
This commit is contained in:
Jaco Greeff 2020-02-13 12:34:30 +01:00 committed by GitHub
parent b1e497a994
commit 43677f5511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,7 @@ function makeUrl (_url: string): StateUrl {
// validation on-top of the values retrieved
function getInitialState (): State {
const url = uiSettings.get().apiUrl;
const isCustom = uiSettings.availableNodes.reduce((isCustom: boolean, { value }): boolean => {
const isCustom = availableEndpoints.reduce((isCustom: boolean, { value }): boolean => {
return isCustom && value !== url;
}, true);
const isValid = isValidUrl(url);
@ -79,7 +79,7 @@ function SelectUrl ({ className, onChange }: Props): React.ReactElement<Props> {
...makeUrl(
isCustom
? info.url
: uiSettings.availableNodes[0].value as string
: availableEndpoints[0].value as string
),
isCustom
});