Remove ssr prepended url from asset service.
This commit is contained in:
		
							parent
							
								
									5a70234370
								
							
						
					
					
						commit
						2054c951ae
					
				@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
 | 
				
			|||||||
import { HttpClient } from '@angular/common/http';
 | 
					import { HttpClient } from '@angular/common/http';
 | 
				
			||||||
import { Observable } from 'rxjs';
 | 
					import { Observable } from 'rxjs';
 | 
				
			||||||
import { shareReplay } from 'rxjs/operators';
 | 
					import { shareReplay } from 'rxjs/operators';
 | 
				
			||||||
import { StateService } from './state.service';
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Injectable({
 | 
					@Injectable({
 | 
				
			||||||
  providedIn: 'root'
 | 
					  providedIn: 'root'
 | 
				
			||||||
@ -14,15 +13,9 @@ export class AssetsService {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  constructor(
 | 
					  constructor(
 | 
				
			||||||
    private httpClient: HttpClient,
 | 
					    private httpClient: HttpClient,
 | 
				
			||||||
    private stateService: StateService,
 | 
					 | 
				
			||||||
  ) {
 | 
					  ) {
 | 
				
			||||||
    let baseApiUrl = '';
 | 
					    this.getAssetsJson$ = this.httpClient.get('/resources/assets.json').pipe(shareReplay());
 | 
				
			||||||
    if (!this.stateService.isBrowser) {
 | 
					    this.getAssetsMinimalJson$ = this.httpClient.get('/resources/assets.minimal.json').pipe(shareReplay());
 | 
				
			||||||
      baseApiUrl = this.stateService.env.BACKEND_ABSOLUTE_URL;
 | 
					    this.getMiningPools$ = this.httpClient.get('/resources/pools.json').pipe(shareReplay());
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    this.getAssetsJson$ = this.httpClient.get(baseApiUrl + '/resources/assets.json').pipe(shareReplay());
 | 
					 | 
				
			||||||
    this.getAssetsMinimalJson$ = this.httpClient.get(baseApiUrl + '/resources/assets.minimal.json').pipe(shareReplay());
 | 
					 | 
				
			||||||
    this.getMiningPools$ = this.httpClient.get(baseApiUrl + '/resources/pools.json').pipe(shareReplay());
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user