Skip to content

Commit

Permalink
PER-9237
Browse files Browse the repository at this point in the history
Fixed the remaining amount after gifting
  • Loading branch information
crisnicandrei committed Oct 27, 2023
1 parent 592e0db commit bba4b8c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class GiftStorageComponent implements OnDestroy {
) {
this.account = this.accountService.getAccount();
this.availableSpace = this.bytesToGigabytes(this.account?.spaceLeft);
console.log(this.availableSpace);
this.giftForm = this.fb.group({
email: [
'',
Expand Down Expand Up @@ -69,7 +70,7 @@ export class GiftStorageComponent implements OnDestroy {
const giftedAmount = Number(this.giftForm.value.amount);
const remainingSpaceAfterGift =
Number(this.availableSpace) - giftedAmount;
this.availableSpace = String(remainingSpaceAfterGift);
this.availableSpace = String(remainingSpaceAfterGift.toFixed(2));

const remainingSpaceInBytes =
remainingSpaceAfterGift * this.bytesPerGigabyte;
Expand Down

0 comments on commit bba4b8c

Please sign in to comment.