Skip to content

Commit

Permalink
sync selected contract
Browse files Browse the repository at this point in the history
  • Loading branch information
bokkypoobah committed Jul 27, 2024
1 parent af27e1b commit 8e62cc3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docs/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const Data = {
const dataModule = {
namespaced: true,
state: {
DB_PROCESSING_BATCH_SIZE: 1234,
DB_PROCESSING_BATCH_SIZE: 12345,

// address => info
addresses: {},
Expand Down Expand Up @@ -926,7 +926,7 @@ const dataModule = {
await context.dispatch('collateRegistrations', parameter);
}

if (options.tokens && !options.devThing) {
if ((options.tokens || options.selectedContract) && !options.devThing) {
await context.dispatch('syncTokenEvents', parameter);
}
if (options.timestamps && !options.devThing) {
Expand All @@ -935,8 +935,7 @@ const dataModule = {
if (options.txData && !options.devThing) {
await context.dispatch('syncTokenEventTxData', parameter);
}
// TODO if ((options.tokens || options.ensExpiries || options.fungiblesMetadata || options.nonFungiblesMetadata) && !options.devThing) {
if ((options.tokens || options.fungiblesMetadata || options.nonFungiblesMetadata) && !options.devThing) {
if ((options.tokens || options.fungiblesMetadata || options.nonFungiblesMetadata || options.selectedContract) && !options.devThing) {
await context.dispatch('computeBalances', parameter);
await context.dispatch('computeApprovals', parameter);
}
Expand Down Expand Up @@ -1654,7 +1653,7 @@ const dataModule = {
let split = false;
const maxLogScrapingSize = NETWORKS['' + parameter.chainId].maxLogScrapingSize || null;
if (!maxLogScrapingSize || (toBlock - fromBlock) <= maxLogScrapingSize) {
const address = null;
const address = parameter.selectedContract;
try {
let topics = null;
if (section == 0) {
Expand Down
1 change: 1 addition & 0 deletions docs/nonFungibles.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ const NonFungibles = {
}
return results;
},

filteredItems() {
const results = (store.getters['data/forceRefresh'] % 2) == 0 ? [] : [];
let regex = null;
Expand Down
10 changes: 10 additions & 0 deletions docs/viewTokenContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const ViewTokenContract = {
<b-form-input size="sm" plaintext id="token-totalsupply" :value="formatERC20(totalSupply, decimals)" class="px-2 w-50"></b-form-input>
</b-form-group>
<b-form-group label="" label-for="token-refresh" label-size="sm" label-cols-sm="3" label-align-sm="right" class="mx-0 my-1 p-0">
<b-button @click="syncTokenContract();" variant="link" v-b-popover.hover="'Refresh balances and approvals'" ><b-icon-arrow-repeat shift-v="+1" font-scale="1.1"></b-icon-arrow-repeat></b-button>
</b-form-group>
<b-form-group v-if="type == 'erc20'" label="Balances:" label-for="token-balances" label-size="sm" label-cols-sm="3" label-align-sm="right" class="mx-0 my-1 p-0">
<b-row class="m-0 p-0">
<b-col cols="5" class="m-0 px-2">
Expand Down Expand Up @@ -282,6 +286,12 @@ const ViewTokenContract = {
console.log(now() + " ERROR ViewTokenContract:methods.handleImage: " + e.message);
}
},
async syncTokenContract() {
console.log(now() + " INFO ViewTokenContract:methods.syncTokenContract");
store.dispatch('data/syncIt', {
selectedContract: this.contract,
});
},
copyToClipboard(str) {
navigator.clipboard.writeText(str);
},
Expand Down

0 comments on commit 8e62cc3

Please sign in to comment.