web/satellite: fix low token balance banner's show condition

Fixed the condition when low token balance is shown.
The bug was related to account balance being returned in dollars instead of cents and this was not handled by 'sum' method.

Change-Id: I35f642302d877c9b1ed9f6f1d03d6091f2942a0b
This commit is contained in:
Vitalii 2023-11-10 17:04:23 +02:00
parent cdcd3b2687
commit f2ccb910df

View File

@ -151,7 +151,7 @@ export interface PaymentsApi {
export class AccountBalance {
constructor(
public freeCredits: number = 0,
// STORJ token balance from storjscan.
// STORJ token balance (in dollars) from storjscan.
private _coins: string = '0',
// STORJ balance (in cents) from stripe. This may include the following.
// 1. legacy Coinpayments deposit.
@ -177,8 +177,9 @@ export class AccountBalance {
return formatPrice(this._coins);
}
// Returns sum of storjscan and legacy (stripe) balances in cents.
public get sum(): number {
return this.credits + this.coins;
return this.credits + (this.coins * 100);
}
public hasCredits(): boolean {