From 6190b32eb803eac5037295c25624f2c4d9151982 Mon Sep 17 00:00:00 2001 From: sairajzero Date: Sun, 6 Jun 2021 17:33:05 +0530 Subject: [PATCH] bugfix --- index.html | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index ded6f56..af1594b 100644 --- a/index.html +++ b/index.html @@ -8269,9 +8269,11 @@ util: { serverList: floGlobals.apiURL[floGlobals.blockchain].slice(0), curPos: floCrypto.randInt(0, floGlobals.apiURL[floGlobals.blockchain].length - 1), - fetch_retry: function (apicall) { + fetch_retry: function (apicall, rm_flosight) { return new Promise((resolve, reject) => { - this.serverList.splice(this.curPos, 1); + let i = this.serverList.indexOf(rm_flosight) + if(i != -1) + this.serverList.splice(i, 1); this.curPos = floCrypto.randInt(0, this.serverList.length - 1) this.fetch_api(apicall) .then(result => resolve(result)) @@ -8283,16 +8285,17 @@ if (this.serverList.length === 0) reject("No floSight server working") else { - fetch(this.serverList[this.curPos] + apicall).then(response => { + let flosight = this.serverList[this.curPos]; + fetch(flosight + apicall).then(response => { if (response.ok) response.json().then(data => resolve(data)); else { - this.fetch_retry(apicall) + this.fetch_retry(apicall, flosight) .then(result => resolve(result)) .catch(error => reject(error)); } }).catch(error => { - this.fetch_retry(apicall) + this.fetch_retry(apicall, flosight) .then(result => resolve(result)) .catch(error => reject(error)); }) @@ -18303,9 +18306,11 @@ util: { serverList: floGlobals.apiURL[floGlobals.blockchain].slice(0), curPos: floCrypto.randInt(0, floGlobals.apiURL[floGlobals.blockchain].length - 1), - fetch_retry: function (apicall) { + fetch_retry: function (apicall, rm_flosight) { return new Promise((resolve, reject) => { - this.serverList.splice(this.curPos, 1); + let i = this.serverList.indexOf(rm_flosight) + if(i != -1) + this.serverList.splice(i, 1); this.curPos = floCrypto.randInt(0, this.serverList.length - 1) this.fetch_api(apicall) .then(result => resolve(result)) @@ -18317,16 +18322,17 @@ if (this.serverList.length === 0) reject("No floSight server working") else { - fetch(this.serverList[this.curPos] + apicall).then(response => { + let flosight = this.serverList[this.curPos]; + fetch(flosight + apicall).then(response => { if (response.ok) response.json().then(data => resolve(data)); else { - this.fetch_retry(apicall) + this.fetch_retry(apicall, flosight) .then(result => resolve(result)) .catch(error => reject(error)); } }).catch(error => { - this.fetch_retry(apicall) + this.fetch_retry(apicall, flosight) .then(result => resolve(result)) .catch(error => reject(error)); })