File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -558,7 +558,11 @@ export class AllocatorsController extends FilPlusEditionControllerBase {
558558
559559 const percentageChange : AllocatorsDashboardStatistic [ 'percentageChange' ] =
560560 ( ( ) => {
561- if ( BigInt ( previousValue . value ) === 0n ) return null ;
561+ const dividerIsZero =
562+ previousValue . type === 'bigint'
563+ ? BigInt ( previousValue . value ) === 0n
564+ : previousValue . value === 0 ;
565+ if ( dividerIsZero ) return null ;
562566
563567 const ratio =
564568 currentValue . type === 'bigint' || previousValue . type === 'bigint'
Original file line number Diff line number Diff line change @@ -408,7 +408,11 @@ export class ClientsController extends ControllerBase {
408408
409409 const percentageChange : ClientsDashboardStatistic [ 'percentageChange' ] =
410410 ( ( ) => {
411- if ( BigInt ( previousValue . value ) === 0n ) return null ;
411+ const dividerIsZero =
412+ previousValue . type === 'bigint'
413+ ? BigInt ( previousValue . value ) === 0n
414+ : previousValue . value === 0 ;
415+ if ( dividerIsZero ) return null ;
412416
413417 const ratio =
414418 currentValue . type === 'bigint' || previousValue . type === 'bigint'
Original file line number Diff line number Diff line change @@ -405,7 +405,11 @@ export class StorageProvidersController extends ControllerBase {
405405
406406 const percentageChange : StorageProvidersDashboardStatistic [ 'percentageChange' ] =
407407 ( ( ) => {
408- if ( BigInt ( previousValue . value ) === 0n ) return null ;
408+ const dividerIsZero =
409+ previousValue . type === 'bigint'
410+ ? BigInt ( previousValue . value ) === 0n
411+ : previousValue . value === 0 ;
412+ if ( dividerIsZero ) return null ;
409413
410414 const ratio =
411415 currentValue . type === 'bigint' || previousValue . type === 'bigint'
You can’t perform that action at this time.
0 commit comments