Skip to content

Commit

Permalink
removing logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Viterbo authored and donnyquixotic committed Feb 19, 2024
1 parent 5bace33 commit 952c704
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
15 changes: 0 additions & 15 deletions src/antelope/stores/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const store_name = 'history';
// (e.g. when loading the balances tab, which prefetches transactions, and quickly switching to the transactions tab)
let fetchAccoutTransactionsIsRunning = false;
let shouldRefetchAccoutTransactions = false;
let counter = 0;

let nftTransfersUpdated : number | null = null; // the time in milliseconds since epoch when the NFT transfers were last updated

Expand Down Expand Up @@ -121,16 +120,12 @@ export const useHistoryStore = defineStore(store_name, {
async fetchEVMTransactionsForAccount(label: Label = CURRENT_CONTEXT) {
this.trace('fetchEVMTransactionsForAccount', label);
const feedbackStore = useFeedbackStore();
const local_counter = counter++;
console.log(local_counter, 'fetchEVMTransactionsForAccount() 1 called');

if (!fetchAccoutTransactionsIsRunning) {
feedbackStore.setLoading('history.fetchEVMTransactionsForAccount');
fetchAccoutTransactionsIsRunning = true;
console.log(local_counter, 'fetchEVMTransactionsForAccount() 2 - running');
} else {
shouldRefetchAccoutTransactions = true;
console.log(local_counter, 'fetchEVMTransactionsForAccount() 3 - queued');
return;
}

Expand All @@ -149,21 +144,17 @@ export const useHistoryStore = defineStore(store_name, {
this.__evm_nft_transfers[label].size === 0 ||
(nftTransfersUpdated && !dateIsWithinXMinutes(nftTransfersUpdated, 3))
) {
console.log(local_counter, 'fetchEVMTransactionsForAccount() 4 - fetching NFT transfers...');
await this.fetchEvmNftTransfersForAccount(label, this.__evm_filter.address);
console.log(local_counter, 'fetchEVMTransactionsForAccount() 5 - done');
}

const lastFilterUsedStr = JSON.stringify(this.__evm_last_filter_used);
const currentFilterStr = JSON.stringify(this.__evm_filter);
if (lastFilterUsedStr !== currentFilterStr) {
this.__evm_last_filter_used = { ... toRaw(this.__evm_filter) };

console.log(local_counter, 'fetchEVMTransactionsForAccount() 6 - fetching transactions...');
const transactionsResponse = await chainSettings.getEVMTransactions(toRaw(this.__evm_filter));
const contracts = transactionsResponse.contracts;
const transactions = transactionsResponse.results;
console.log(local_counter, 'fetchEVMTransactionsForAccount() 7 - done');

this.setEvmTransactionsRowCount(label, transactionsResponse.total_count);

Expand All @@ -184,27 +175,21 @@ export const useHistoryStore = defineStore(store_name, {

this.setEVMTransactions(label, transactions);

console.log(local_counter, 'fetchEVMTransactionsForAccount() 8 - shaping transactions...');
await this.shapeTransactions(label, transactions);
console.log(local_counter, 'fetchEVMTransactionsForAccount() 9 - done');
} else {
console.log(local_counter, 'fetchEVMTransactionsForAccount() 10 - no need to fetch transactions');
}
} catch (error) {
console.error(error);
throw new AntelopeError('antelope.history.error_fetching_transactions');
} finally {
fetchAccoutTransactionsIsRunning = false;
console.log(local_counter, 'fetchEVMTransactionsForAccount() 11 - stop running');

if (shouldRefetchAccoutTransactions) {
console.log(local_counter, 'fetchEVMTransactionsForAccount() 12 - refetching...');
await this.fetchEVMTransactionsForAccount(label);
} else {
feedbackStore.unsetLoading('history.fetchEVMTransactionsForAccount');
}

console.log(local_counter, 'fetchEVMTransactionsForAccount() 13 - FINISHED');
}
},

Expand Down
6 changes: 0 additions & 6 deletions src/pages/evm/wallet/WalletTransactionsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export default defineComponent({
const { rowsPerPage, page } = newPagination;
console.log(this.loading, this.shapedTransactions.length, 'watch(pagination)', toRaw(newPagination));
this.$router.replace({
name: 'evm-wallet',
query: {
Expand Down Expand Up @@ -111,7 +110,6 @@ export default defineComponent({
} else {
this.pagination.rowsNumber = newValue;
}
console.log(this.loading, this.shapedTransactions.length, 'watch(totalRows)', newValue, toRaw(this.pagination));
},
},
$route(newRoute) {
Expand All @@ -126,7 +124,6 @@ export default defineComponent({
rowsNumber: this.pagination.rowsNumber,
};
console.log(this.loading, this.shapedTransactions.length, 'watch($route)', toRaw(this.pagination));
this.getTransactions().finally(() => {
this.rowsPerPageUpdating = false;
});
Expand Down Expand Up @@ -166,7 +163,6 @@ export default defineComponent({
this.pagination.rowsCurrentPage = this.pagination.rowsPerPage;
}
console.log(this.loading, this.shapedTransactions.length, 'getTransactions()', toRaw(this.pagination));
if (this.address) {
historyStore.setEVMTransactionsFilter({
Expand All @@ -176,11 +172,9 @@ export default defineComponent({
includeAbi: true,
});
try {
console.log(this.loading, this.shapedTransactions.length, 'getTransactions() --> fetchEVMTransactionsForAccount() ...');
await historyStore.fetchEVMTransactionsForAccount(CURRENT_CONTEXT);
this.pagination.rowsNumber = historyStore.getEvmTransactionsRowCount(CURRENT_CONTEXT);
this.initialLoadComplete = true;
console.log(this.loading, this.shapedTransactions.length, 'getTransactions() --> fetchEVMTransactionsForAccount() done', toRaw(this.pagination));
} catch (e) {
if (e instanceof AntelopeError) {
getAntelope().config.notifyFailureMessage(e.message, e.payload);
Expand Down

0 comments on commit 952c704

Please sign in to comment.