From 8c2fb3a239b21e78a7877cecd5012710ea29d95e Mon Sep 17 00:00:00 2001 From: Ritika-Agrawal0811 Date: Sun, 6 Jun 2021 18:00:47 +0530 Subject: [PATCH] bug fix fixed util --- index.html | 13 ++++++++----- test.html | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index a0233ec..97b1f2a 100644 --- a/index.html +++ b/index.html @@ -10796,9 +10796,11 @@ Bitcoin.Util = { util: { serverList: floGlobals.apiURL[floGlobals.blockchain].slice(0), curPos: floCrypto.randInt(0, floGlobals.apiURL[floGlobals.blockchain].length), - 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) this.fetch_api(apicall) .then(result => resolve(result)) @@ -10810,16 +10812,17 @@ Bitcoin.Util = { 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)); }) diff --git a/test.html b/test.html index e304ec6..2e17b1b 100644 --- a/test.html +++ b/test.html @@ -48,6 +48,8 @@
Profile
Hobbies
Education
+
Family
+
Career