Skip to content

Commit

Permalink
#172 - fixed fault display component & total timer now has client lif…
Browse files Browse the repository at this point in the history
…etime total
  • Loading branch information
bracyw committed Aug 23, 2024
1 parent 226e673 commit fbac39a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand All @@ -35,6 +35,7 @@ export default class ActiveStatus {
this.intervalId = setInterval(() => {
this.currentSeconds++;
this.totalSeconds++;
localStorage.setItem('active total seconds', this.totalSeconds.toString());
}, 1000);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand All @@ -35,6 +35,7 @@ export default class BalancingStatus {
this.intervalId = setInterval(() => {
this.currentSeconds++;
this.totalSeconds++;
localStorage.setItem('balancing total seconds', this.totalSeconds.toString());
}, 1000);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand All @@ -36,6 +36,7 @@ export default class ChargingStatusComponent {
this.intervalId = setInterval(() => {
this.currentSeconds++;
this.totalSeconds++;
localStorage.setItem('charging total seconds', this.totalSeconds.toString());
}, 1000);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
></typography>
<typography
variant="info-subtitle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { floatPipe } from 'src/utils/pipes.utils';
export default class FaultedStatus {
isFaulted: boolean = false;
currentSeconds: number = 0;
totalSeconds: number = 0;
totalSeconds: number = Number(localStorage.getItem('faulted total seconds')) || 0;
intervalId!: NodeJS.Timeout;
constructor(private storage: Storage) {}

Expand All @@ -35,6 +35,7 @@ export default class FaultedStatus {
this.intervalId = setInterval(() => {
this.currentSeconds++;
this.totalSeconds++;
localStorage.setItem('faulted total seconds', this.totalSeconds.toString());
}, 1000);
}

Expand Down

0 comments on commit fbac39a

Please sign in to comment.