Including gitCommit and version in frontend build. Backend now sending a backendInfo object containing commit, version and hostname. All printed on About page.

This commit is contained in:
softsimon
2021-04-12 22:17:13 +04:00
parent f61e3d8cec
commit 7a4ad0ee2f
12 changed files with 74 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { webSocket, WebSocketSubject } from 'rxjs/webSocket';
import { WebsocketResponse } from '../interfaces/websocket.interface';
import { WebsocketResponse, IBackendInfo } from '../interfaces/websocket.interface';
import { StateService } from './state.service';
import { Block, Transaction } from '../interfaces/electrs.interface';
import { Subscription } from 'rxjs';
@@ -236,13 +236,13 @@ export class WebsocketService {
this.stateService.bsqPrice$.next(response['bsq-price']);
}
if (response['git-commit']) {
this.stateService.gitCommit$.next(response['git-commit']);
if (response.backendInfo) {
this.stateService.backendInfo$.next(response.backendInfo);
if (!this.latestGitCommit) {
this.latestGitCommit = response['git-commit'];
this.latestGitCommit = response.backendInfo.gitCommit;
} else {
if (this.latestGitCommit !== response['git-commit']) {
if (this.latestGitCommit !== response.backendInfo.gitCommit) {
setTimeout(() => {
window.location.reload();
}, Math.floor(Math.random() * 60000) + 60000);
@@ -283,7 +283,7 @@ export class WebsocketService {
}
if (response['git-commit']) {
this.stateService.gitCommit$.next(response['git-commit']);
this.stateService.backendInfo$.next(response['git-commit']);
}
}
}