merge from master

This commit is contained in:
softsimon
2020-07-05 23:24:06 +07:00
5 changed files with 55 additions and 44 deletions

View File

@@ -4,7 +4,7 @@ import { Observable } from 'rxjs';
import { Block, Transaction, Address, Outspend, Recent, Asset } from '../interfaces/electrs.interface';
import { StateService } from './state.service';
const API_BASE_URL = document.location.protocol + '//' + document.location.hostname + ':' + document.location.port + '/electrs';
const API_BASE_URL = '{network}/api';
@Injectable({
providedIn: 'root'
@@ -16,12 +16,12 @@ export class ElectrsApiService {
private httpClient: HttpClient,
private stateService: StateService,
) {
this.apiBaseUrl = API_BASE_URL;
this.apiBaseUrl = API_BASE_URL.replace('{network}', '');
this.stateService.networkChanged$.subscribe((network) => {
if (network === 'bisq') {
network = '';
}
this.apiBaseUrl = API_BASE_URL + '/' + network;
this.apiBaseUrl = API_BASE_URL.replace('{network}', network ? '/' + network : '');
});
}