Fix graph legend update while load bug and remove unnecessary query
This commit is contained in:
		
							parent
							
								
									cca798eeaa
								
							
						
					
					
						commit
						0654872627
					
				@ -227,10 +227,8 @@ class MiningRoutes {
 | 
			
		||||
        throw new Error('from must be less than to');
 | 
			
		||||
      }
 | 
			
		||||
      const blockFees = await mining.$getBlockFeesTimespan(parseInt(req.query.from as string, 10), parseInt(req.query.to as string, 10));
 | 
			
		||||
      const blockCount = await BlocksRepository.$blockCount(null, null);
 | 
			
		||||
      res.header('Pragma', 'public');
 | 
			
		||||
      res.header('Cache-control', 'public');
 | 
			
		||||
      res.header('X-total-count', blockCount.toString());
 | 
			
		||||
      res.setHeader('Expires', new Date(Date.now() + 1000 * 60).toUTCString());
 | 
			
		||||
      res.json(blockFees);
 | 
			
		||||
    } catch (e) {
 | 
			
		||||
 | 
			
		||||
@ -396,6 +396,10 @@ export class BlockFeesSubsidyGraphComponent implements OnInit {
 | 
			
		||||
    this.chartInstance = ec;
 | 
			
		||||
 | 
			
		||||
    this.chartInstance.on('legendselectchanged', (params) => {
 | 
			
		||||
      if (this.isLoading) {
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      let mode: 'normal' | 'fiat' | 'percentage';
 | 
			
		||||
      if (params.name.includes('USD')) {
 | 
			
		||||
        mode = 'fiat';
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user