Fix reset logic
This commit is contained in:
parent
136514d33a
commit
1b7ab8b038
1 changed files with 1 additions and 6 deletions
|
|
@ -10,7 +10,6 @@ import type { Settings } from "../persistence/settings";
|
||||||
import type { FileOperations } from "../file-operations/file-operations";
|
import type { FileOperations } from "../file-operations/file-operations";
|
||||||
import { findMatchingFile } from "../utils/find-matching-file";
|
import { findMatchingFile } from "../utils/find-matching-file";
|
||||||
import { UnrestrictedSyncer } from "./unrestricted-syncer";
|
import { UnrestrictedSyncer } from "./unrestricted-syncer";
|
||||||
import { FileNotFoundError } from "../file-operations/safe-filesystem-operations";
|
|
||||||
import { createPromise } from "../utils/create-promise";
|
import { createPromise } from "../utils/create-promise";
|
||||||
|
|
||||||
export class Syncer {
|
export class Syncer {
|
||||||
|
|
@ -212,7 +211,7 @@ export class Syncer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async applyRemoteChangesLocally(): Promise<void> {
|
public async applyRemoteChangesLocally(): Promise<void> {
|
||||||
if (this.runningApplyRemoteChangesLocally != null) {
|
if (this.runningApplyRemoteChangesLocally !== undefined) {
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
"Applying remote changes locally is already in progress"
|
"Applying remote changes locally is already in progress"
|
||||||
);
|
);
|
||||||
|
|
@ -237,11 +236,7 @@ export class Syncer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async reset(): Promise<void> {
|
public async reset(): Promise<void> {
|
||||||
this.syncQueue.clear();
|
|
||||||
await this.syncQueue.onEmpty();
|
await this.syncQueue.onEmpty();
|
||||||
this.remainingOperationsListeners.forEach((listener) => {
|
|
||||||
listener(0);
|
|
||||||
});
|
|
||||||
this.internalSyncer.reset();
|
this.internalSyncer.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue