Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
mawe committed Dec 29, 2023
1 parent de8b939 commit 5f112ff
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 31 deletions.
18 changes: 9 additions & 9 deletions static/js/banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ function updateBanner() {
if (data.currentEpoch) {
epochHandle.innerHTML = addCommas(data.currentEpoch)
epochHandle.setAttribute("href", "/epoch/" + data.currentEpoch)
}
}

var slotHandle = document.getElementById("banner-slot-data")
if (data.currentSlot) {
slotHandle.innerHTML = addCommas(data.currentSlot)
slotHandle.setAttribute("href", "/slot/" + data.currentSlot)
}
}

var ethPriceHandle = document.getElementById("banner-eth-price-data")
if (ethPriceHandle) {
Expand All @@ -58,7 +58,7 @@ function updateBanner() {
} catch (err) {
console.error("failed updating banner-price:", err)
}
}
}

var finDelayDataHandle = document.getElementById("banner-fin-data")
finDelayHtml = `
Expand All @@ -76,7 +76,7 @@ function updateBanner() {
<i class="fas fa-exclamation-triangle item-text" data-toggle="tooltip" title="" data-original-title="The last finalized epoch was ${data.finalityDelay} epochs ago."></i>
</div>
</div>
`
`

if (!finDelayDataHandle && data.finalityDelay > 3 && !data.syncing) {
// create fin delay node
Expand All @@ -91,15 +91,15 @@ function updateBanner() {
for (let i = 0; i < icons.length; i++) {
const icon = icons[i]
icon.setAttribute("data-original-title", `The last finalized epoch was ${data.finalityDelay} epochs ago.`)
}
}

var slotHandle = document.getElementById("banner-slot-data")

Check failure on line 96 in static/js/banner.js

View workflow job for this annotation

GitHub Actions / lint-format

'slotHandle' is already defined
if (data.currentSlot) {
slotHandle.innerHTML = addCommas(data.currentSlot)
slotHandle.setAttribute("href", "/slot/" + data.currentSlot)
}
}

var ethPriceHandle = document.getElementById("banner-eth-price-data")
var ethPriceHandle = document.getElementById("banner-eth-price-data")

Check failure on line 102 in static/js/banner.js

View workflow job for this annotation

GitHub Actions / lint-format

'ethPriceHandle' is already defined

try {
let userCurrency = getCookie("currency")
Expand All @@ -108,7 +108,7 @@ function updateBanner() {
ethPriceHandle.innerHTML = `<span class='currency-symbol'>${price.symbol} </span><span class='k-formatted-price'>${price.truncPrice}</span><span class='price'>${addCommas(price.roundPrice)}</span>`
} catch (err) {
console.error("failed updating banner-price:", err)
}
}

var finDelayDataHandle = document.getElementById("banner-fin-data")

Check failure on line 113 in static/js/banner.js

View workflow job for this annotation

GitHub Actions / lint-format

'finDelayDataHandle' is already defined
finDelayHtml = `
Expand Down Expand Up @@ -153,7 +153,7 @@ function updateBanner() {
if (data.syncing) {
// remove fin delay if we are still syncing
let findDelayHandle = document.getElementById("banner-fin")
if (findDelayHandle) findDelayHandle.remove()
if (findDelayHandle) findDelayHandle.remove()

var bannerHandle = document.getElementById("banner-status")
if (!bannerHandle) {
Expand Down
30 changes: 16 additions & 14 deletions static/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,25 +324,27 @@ function showProposedHistoryTable() {
fetch("/dashboard/data/proposalshistory" + getValidatorQueryString(), {
method: "GET",
}).then((res) => {
res.json().then(function (data) {
let proposedHistTableData = []
for (let item of data.data) {
proposedHistTableData.push([item[0], item[1], [item[2], item[3], item[4]]])
}
renderProposedHistoryTable(proposedHistTableData)
})
.then((res) => {
res.json().then(function (data) {
res
.json()
.then(function (data) {
let proposedHistTableData = []
for (let item of data) {
for (let item of data.data) {
proposedHistTableData.push([item[0], item[1], [item[2], item[3], item[4]]])
}
renderProposedHistoryTable(proposedHistTableData)
})
})
.finally(() => {
resetTurnstileToken()
})
.then((res) => {
res.json().then(function (data) {
let proposedHistTableData = []
for (let item of data) {
proposedHistTableData.push([item[0], item[1], [item[2], item[3], item[4]]])
}
renderProposedHistoryTable(proposedHistTableData)
})
})
.finally(() => {
resetTurnstileToken()
})
})
})
}
Expand Down
14 changes: 7 additions & 7 deletions static/js/turnstile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function renderTurnStile() {
callback: function (token) {
window.turnstileToken = token
console.log(`Challenge Success ${token}`)
verifyTurnStileToken(() => {
verifyTurnStileToken(() => {
window.isRequestingTurnstileToken = false
})
},
Expand Down Expand Up @@ -80,12 +80,12 @@ function verifyTurnStileToken(cb) {
"X-TURNSTILE-TOKEN": window.turnstileToken,
},
})
.then((res) => {
cb && cb()
})
.catch((err) => {
console.log("error verifying turnstile token", err)
})
.then((res) => {
cb && cb()
})
.catch((err) => {
console.log("error verifying turnstile token", err)
})
}
// resetting a widget causes it to rerender
// rerender only if the cookie is not present and there has been no request already for a token
Expand Down
1 change: 0 additions & 1 deletion static/js/validatorRewards.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var subsTable = null
// let validators = []

function create_typeahead(input_container) {

var timeWait = 0
var debounce = function (context, func) {
var timeout, result
Expand Down

0 comments on commit 5f112ff

Please sign in to comment.