diff --git a/angular-client/src/pages/charging-page/components/active-status/active-status.component.ts b/angular-client/src/pages/charging-page/components/active-status/active-status.component.ts index 5bceafde..d15c872f 100644 --- a/angular-client/src/pages/charging-page/components/active-status/active-status.component.ts +++ b/angular-client/src/pages/charging-page/components/active-status/active-status.component.ts @@ -12,7 +12,7 @@ import { floatPipe } from 'src/utils/pipes.utils'; export default class ActiveStatus { isActive: boolean = false; currentSeconds: number = 0; - totalSeconds: number = 0; + totalSeconds: number = Number(localStorage.getItem('active total seconds')) || 0; intervalId!: NodeJS.Timeout; constructor(private storage: Storage) {} @@ -35,6 +35,7 @@ export default class ActiveStatus { this.intervalId = setInterval(() => { this.currentSeconds++; this.totalSeconds++; + localStorage.setItem('active total seconds', this.totalSeconds.toString()); }, 1000); } diff --git a/angular-client/src/pages/charging-page/components/balancing-status/balancing-status.component.ts b/angular-client/src/pages/charging-page/components/balancing-status/balancing-status.component.ts index 3e3b73ee..bf9a60f3 100644 --- a/angular-client/src/pages/charging-page/components/balancing-status/balancing-status.component.ts +++ b/angular-client/src/pages/charging-page/components/balancing-status/balancing-status.component.ts @@ -12,7 +12,7 @@ import { floatPipe } from 'src/utils/pipes.utils'; export default class BalancingStatus { isBalancing: boolean = false; currentSeconds: number = 0; - totalSeconds: number = 0; + totalSeconds: number = Number(localStorage.getItem('balancing total seconds')) || 0; intervalId!: NodeJS.Timeout; constructor(private storage: Storage) {} @@ -35,6 +35,7 @@ export default class BalancingStatus { this.intervalId = setInterval(() => { this.currentSeconds++; this.totalSeconds++; + localStorage.setItem('balancing total seconds', this.totalSeconds.toString()); }, 1000); } diff --git a/angular-client/src/pages/charging-page/components/charging-state/charging-status.component.ts b/angular-client/src/pages/charging-page/components/charging-state/charging-status.component.ts index 32c3560d..541c028f 100644 --- a/angular-client/src/pages/charging-page/components/charging-state/charging-status.component.ts +++ b/angular-client/src/pages/charging-page/components/charging-state/charging-status.component.ts @@ -12,7 +12,7 @@ import { floatPipe } from 'src/utils/pipes.utils'; export default class ChargingStatusComponent { isCharging: boolean = false; currentSeconds: number = 0; - totalSeconds: number = 0; + totalSeconds: number = Number(localStorage.getItem('charging total seconds')) || 0; intervalId!: NodeJS.Timeout; constructor(private storage: Storage) {} @@ -36,6 +36,7 @@ export default class ChargingStatusComponent { this.intervalId = setInterval(() => { this.currentSeconds++; this.totalSeconds++; + localStorage.setItem('charging total seconds', this.totalSeconds.toString()); }, 1000); } diff --git a/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.html b/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.html index daf30504..b68358c7 100644 --- a/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.html +++ b/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.html @@ -20,7 +20,7 @@ variant="info-subtitle" [content]="fault.name" additionalStyles="font-weight: bold;" - style="width: 33%; height: 40px; padding-top: 10px; width: 350px" + style="width: 33%; height: 40px; padding-top: 10px; width: 400px" > { this.currentSeconds++; this.totalSeconds++; + localStorage.setItem('faulted total seconds', this.totalSeconds.toString()); }, 1000); }