@@ -4,7 +4,7 @@ import { WalletService } from '../../services/wallet.service';
44import { MatDialog } from '@angular/material/dialog' ;
55import { MatSnackBar } from '@angular/material/snack-bar' ;
66import { TranslocoService } from '@ngneat/transloco' ;
7- import { BalanceResponse , ContractDto , ProposalDto , Transaction } from '../../services/api.model' ;
7+ import { ContractDto , Transaction } from '../../services/api.model' ;
88import { FormBuilder , FormControl , Validators } from '@angular/forms' ;
99import { UpdaterService } from '../../services/updater-service' ;
1010import { ActivatedRoute , Router } from '@angular/router' ;
@@ -36,7 +36,6 @@ export class PlaceBidComponent implements OnInit, OnDestroy {
3636 public currentTick = 0 ;
3737 public contractIndex : number | undefined ;
3838 private sub : any ;
39- public balances : BalanceResponse [ ] = [ ] ;
4039 public tickOverwrite = false ;
4140 public maxAmount : number = 0 ;
4241 public ipoContract : ContractDto | undefined ;
@@ -78,9 +77,6 @@ export class PlaceBidComponent implements OnInit, OnDestroy {
7877 }
7978
8079 init ( ) : void {
81- this . us . currentBalance . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( s => {
82- this . balances = s ;
83- } ) ;
8480 this . us . currentTick . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( tick => {
8581 this . currentTick = tick ;
8682 this . ipoForm . controls . tick . addValidators ( Validators . min ( tick ) ) ;
@@ -142,13 +138,7 @@ export class PlaceBidComponent implements OnInit, OnDestroy {
142138 }
143139
144140 getMaxAmount ( publicId : string ) {
145- this . us . currentBalance . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( s => {
146- if ( s && s . length > 0 && s . find ( f => f . publicId == publicId ) ) {
147- this . maxAmount = s . find ( f => f . publicId == publicId ) ?. currentEstimatedAmount ?? s . find ( f => f . publicId == publicId ) ?. epochBaseAmount ?? 0 ;
148- } else {
149- this . maxAmount = 0 ;
150- }
151- } ) ;
141+ this . maxAmount = this . walletService . getSeed ( publicId ) ?. balance ?? 0 ;
152142 }
153143
154144 setAmounToMax ( addAmount : number = 0 ) {
0 commit comments