Skip to content

Commit

Permalink
(BIDS-2636) addressed CR issues
Browse files Browse the repository at this point in the history
  • Loading branch information
remoterami committed Jan 18, 2024
1 parent 0704d04 commit fece9a3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion handlers/eth1tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func getEth1TransactionTxData(txhash, currency string) *types.DataTableResponse
txData, err := eth1data.GetEth1Transaction(common.BytesToHash(txHash), currency)
its := txData.InternalTxns
if err != nil {
fmt.Println("hello")
utils.LogError(err, "error getting transaction data", 0, map[string]interface{}{"txhash": txHash})
} else {
for _, i := range its {
tableData = append(tableData, []interface{}{
Expand Down
27 changes: 21 additions & 6 deletions templates/eth1tx.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,27 @@
}

window.addEventListener("DOMContentLoaded", function (ev) {
window.navigation.addEventListener("navigate", (event) => {
if (!event.destination?.url || event.destination.url.split("#")[0] != event.srcElement?.currentEntry?.url?.split("#")[0]) {
if (window.navigation) {
window.navigation.addEventListener("navigate", (event) => {
if (!event.destination?.url || event.destination.url.split("#")[0] != event.srcElement?.currentEntry?.url?.split("#")[0]) {
return
}
handleTabChange(event.destination?.url)
})
} else {
//handle Firefox specific way as it does not support the navigation way
const tabBarContainer = $(`#eth1TxTabs`)
if (!tabBarContainer) {
return
}
handleTabChange(event.destination?.url)
})

tabBarContainer.find(`.nav-link`).on("click", event => {
var href = event.currentTarget.href
if (href) {
handleTabChange(href)
}
})
}
handleTabChange(window.location.href)
})

Expand Down Expand Up @@ -112,11 +127,11 @@ <h1 class="h4 mb-1 mb-md-0">
{{ with .Data }}
<div class="card">
<div class="card-header">
<div id="advanced-itx" class="hide mr-20 float-right">
<div id="advanced-itx" class="mr-20 float-right" style="display: none;">
<div class="float-right">
<span class="text-monospace mr-2">Advanced</span>
<label class="advanced-itx-switch float-right" for="advanced-itx-toggle">
<input type="checkbox" id="advanced-itx-toggle" />
<input type="checkbox" id="advanced-itx-toggle" autocomplete="off" />
<div class="slider round"></div>
</label>
</div>
Expand Down
2 changes: 1 addition & 1 deletion utils/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func formatCurrencyString(valIf interface{}, valueCurrency, targetCurrency strin
// add trailing zeros to always have the same amount of digits after the comma
dotIndex := strings.Index(valStr, ".")
if dotIndex >= 0 {
if !strings.HasSuffix(amountStr, ".") {
if !strings.Contains(amountStr, ".") {
amountStr += "."
}
missingZeros := digitsAfterComma - (len(amountStr) - dotIndex - 1)
Expand Down

0 comments on commit fece9a3

Please sign in to comment.