From 48e84d3c6f3d552f423f39318bbb1a2e29871ab4 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 21 Nov 2020 21:58:12 -0500 Subject: [PATCH] Apply hawken93's patch --- src/scripts/clientUtils.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/scripts/clientUtils.js b/src/scripts/clientUtils.js index 6e98142628..5b43cd4695 100644 --- a/src/scripts/clientUtils.js +++ b/src/scripts/clientUtils.js @@ -35,18 +35,14 @@ export async function serverAddress() { urls.push(...await webSettings.getServers()); const promises = urls.map(url => { - return fetch(`${url}/System/Info/Public`).catch(error => { + return fetch(`${url}/System/Info/Public`).then(resp => url).catch(error => { return Promise.resolve(); }); }); return Promise.all(promises).then(responses => { - responses = responses.filter(response => response && response.ok); - return Promise.all(responses.map(response => response.json())); - }).then(configs => { - let selection = configs.find(config => !config.StartupWizardCompleted); - if (!selection) selection = configs[0]; - return Promise.resolve(selection.LocalAddress); + responses = responses.filter(response => response); + return responses[0]; }).catch(error => { console.log(error); return Promise.resolve();