just set this.metrics

This commit is contained in:
Drew Ansbacher
2021-11-16 16:50:05 -07:00
committed by Aiden McClelland
parent 25775ab2a1
commit 4d86d13e48

View File

@@ -54,15 +54,7 @@ export class ServerMetricsPage {
private async getMetrics (): Promise<void> {
try {
const metrics = await this.embassyApi.getServerMetrics({ })
Object.entries(metrics).forEach(([groupKey, groupVal]) => {
if (!this.metrics[groupKey]) {
this.metrics[groupKey] = groupVal
}
Object.entries(groupVal).forEach(([key, val]) => {
this.metrics[groupKey][key] = val
})
})
this.metrics = await this.embassyApi.getServerMetrics({ })
} catch (e) {
this.errToast.present(e)
this.stopDaemon()