Refactor sync history
This commit is contained in:
parent
60b6d90b6c
commit
c391aede1f
1 changed files with 4 additions and 2 deletions
|
|
@ -36,10 +36,12 @@ export interface HistoryStats {
|
||||||
export class SyncHistory {
|
export class SyncHistory {
|
||||||
private static readonly MAX_ENTRIES = 1000;
|
private static readonly MAX_ENTRIES = 1000;
|
||||||
|
|
||||||
private entries: HistoryEntry[] = [];
|
private readonly entries: HistoryEntry[] = [];
|
||||||
|
|
||||||
private readonly syncHistoryUpdateListeners: ((
|
private readonly syncHistoryUpdateListeners: ((
|
||||||
status: HistoryStats
|
status: HistoryStats
|
||||||
) => void)[] = [];
|
) => void)[] = [];
|
||||||
|
|
||||||
private status: HistoryStats = {
|
private status: HistoryStats = {
|
||||||
success: 0,
|
success: 0,
|
||||||
error: 0,
|
error: 0,
|
||||||
|
|
@ -50,7 +52,7 @@ export class SyncHistory {
|
||||||
}
|
}
|
||||||
|
|
||||||
public reset(): void {
|
public reset(): void {
|
||||||
this.entries = [];
|
this.entries.length = 0;
|
||||||
this.status = {
|
this.status = {
|
||||||
success: 0,
|
success: 0,
|
||||||
error: 0,
|
error: 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue