Skip to content

Commit

Permalink
fix: era subscription bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbulat committed Nov 2, 2024
1 parent 9298844 commit 6bbc917
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/model/Subscribe/ActiveEra/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ export class ActiveEra implements Unsubscribable {
// determine activeEra: toString used as alternative to `toHuman`, that puts commas in
// numbers
const activeEra = JSON.parse(result.unwrapOrDefault().toString());

// Return early if errornous active era is returned.
if (activeEra.index === 0 || !activeEra.start) {
return;
}

// Store active era.
this.activeEra = {
index: new BigNumber(activeEra.index),
Expand Down

0 comments on commit 6bbc917

Please sign in to comment.