Add token balance after response from worker.
This commit is contained in:
		
							parent
							
								
									b6e81bcbe1
								
							
						
					
					
						commit
						ab4cb59975
					
				@ -211,6 +211,13 @@ export class UserService {
 | 
			
		||||
      if (typeof Worker !== 'undefined') {
 | 
			
		||||
        const worker = new Worker('@app/_workers/fetch-accounts.worker', { type: 'module' });
 | 
			
		||||
        worker.onmessage = ({ data }) => {
 | 
			
		||||
          this.tokenService.load.subscribe(async (status: boolean) => {
 | 
			
		||||
            if (status) {
 | 
			
		||||
              data.balance = await this.tokenService.getTokenBalance(
 | 
			
		||||
                data.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0]
 | 
			
		||||
              );
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
          this.addAccount(data, limit);
 | 
			
		||||
        };
 | 
			
		||||
        worker.postMessage({
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user