Skip to content

Commit

Permalink
Refactor useWaitingIndexing hook to handle contract timestamp and ind…
Browse files Browse the repository at this point in the history
…exed timestamp comparison (#21)
  • Loading branch information
snoopy1412 authored Oct 28, 2024
1 parent 00b5c9e commit 50109b5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/hooks/useWaitingIndexing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ function useCheckWaitingIndexing() {
fetchDeploymentMeta(currentChainId)
]);

if (updateTimeStamp && deploymentMeta?._meta?.block?.timestamp) {
const contractTimestamp = BigInt(updateTimeStamp.toString());
if (deploymentMeta?._meta?.block?.timestamp) {
const contractTimestamp = updateTimeStamp ? BigInt(updateTimeStamp.toString()) : 0n;
const indexedTimestamp = BigInt(deploymentMeta._meta.block.timestamp);
console.log('contractTimestamp', contractTimestamp);
console.log('indexedTimestamp', indexedTimestamp);
const isDeployed = contractTimestamp <= indexedTimestamp;
if (!isDeployed) {
open();
Expand Down

0 comments on commit 50109b5

Please sign in to comment.