Skip to content

Commit

Permalink
fix(checkDataSourceAvailability): timestamp of localhost data was null
Browse files Browse the repository at this point in the history
  • Loading branch information
rulfo71 committed Mar 23, 2023
1 parent 166426b commit 96f3bfb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export const checkDataSourceAvailability = async chainId => {
);
const { data, errors } = await response.json();

if (data?._meta?.block?.timestamp < Math.floor(Date.now() / 1000) - 600) {
if (
data?._meta?.block?.timestamp !== null &&
data?._meta?.block?.timestamp < Math.floor(Date.now() / 1000) - 600
) {
console.debug('Subgraph out of sync, using fallback');
return false;
}
Expand Down

0 comments on commit 96f3bfb

Please sign in to comment.