Skip to content

Commit

Permalink
Merge pull request #764 from telosnetwork/737-teloscan-date-nan-issues
Browse files Browse the repository at this point in the history
#737 | workaround for the NaN age + fix false values not showing
  • Loading branch information
pmjanus authored May 31, 2024
2 parents 7ac362a + 8817abc commit 083952c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/ContractTab/FunctionInterface.vue
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ export default defineComponent({
<p class="text-negative output-container">
{{ errorMessage }}
</p>
<div v-if="result" class="output-container">
<div v-if="result !== null" class="output-container">
{{ $t('components.contract_tab.result') }} ({{ abi?.outputs.length > 0 ? abi.outputs[0].type : '' }}):
<router-link v-if="abi?.outputs?.[0]?.type === 'address'" :to="`/address/${result}`" >{{ result }}</router-link>
<template v-else>{{ result }}</template>
Expand Down
10 changes: 10 additions & 0 deletions src/components/InternalTransactionFlatTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,16 @@ export default {
this.pagination.sortBy = sortBy;
this.pagination.descending = descending;
this.transactions = [...result.data.results];
this.transactions.forEach((transaction) => {
let timestamp = transaction.timestamp;
// This is a workaround to fix the timestamp issue (it should be fixed in the API)
// https://github.com/telosnetwork/teloscan-indexer/issues/234
if (typeof timestamp === 'string') {
timestamp = new Date(timestamp).getTime() - new Date().getTimezoneOffset() * 60 * 1000;
transaction.timestamp = timestamp;
}
});
let totalTraces = 0;
let processedTransactions = 0;
for (const transaction of this.transactions) {
Expand Down

0 comments on commit 083952c

Please sign in to comment.