Skip to content

Commit

Permalink
Signess: Corrects duration blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Yauheni authored and YauheniDraichykau committed May 20, 2024
1 parent 72b1554 commit 33dd4c9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ function useCreateSession(programId: HexString, metadata: ProgramMetadata | unde
};

const getDurationBlocks = (durationMS: number) => {
const blockTimeMs = api?.consts.babe.expectedBlockTime.toNumber();
if (!api) {
return;
}

const blockTimeMs = api.consts.babe.expectedBlockTime.toNumber();

return durationMS / blockTimeMs;
};
Expand Down

0 comments on commit 33dd4c9

Please sign in to comment.