mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-03-23 18:25:17 +00:00
Indeed, even though if this changeset is mostly another nightmare. It might be in beta for a while.
23 lines
1.0 KiB
TypeScript
23 lines
1.0 KiB
TypeScript
import type { InjectableServiceHub } from "../../lib/src/services/InjectableServices.ts";
|
|
import type { LiveSyncCore } from "../../main.ts";
|
|
import { AbstractModule } from "../AbstractModule.ts";
|
|
|
|
export class ModuleRemoteGovernor extends AbstractModule {
|
|
private async _markRemoteLocked(lockByClean: boolean = false): Promise<void> {
|
|
return await this.core.replicator.markRemoteLocked(this.settings, true, lockByClean);
|
|
}
|
|
|
|
private async _markRemoteUnlocked(): Promise<void> {
|
|
return await this.core.replicator.markRemoteLocked(this.settings, false, false);
|
|
}
|
|
|
|
private async _markRemoteResolved(): Promise<void> {
|
|
return await this.core.replicator.markRemoteResolved(this.settings);
|
|
}
|
|
onBindFunction(core: LiveSyncCore, services: InjectableServiceHub): void {
|
|
services.remote.handleMarkLocked(this._markRemoteLocked.bind(this));
|
|
services.remote.handleMarkUnlocked(this._markRemoteUnlocked.bind(this));
|
|
services.remote.handleMarkResolved(this._markRemoteResolved.bind(this));
|
|
}
|
|
}
|