diff --git a/frontend/obsidian-plugin/src/views/logs-view.ts b/frontend/obsidian-plugin/src/views/logs-view.ts index 62a2bf22..a7ea6228 100644 --- a/frontend/obsidian-plugin/src/views/logs-view.ts +++ b/frontend/obsidian-plugin/src/views/logs-view.ts @@ -1,13 +1,14 @@ import type { WorkspaceLeaf } from "obsidian"; import { ItemView } from "obsidian"; -import { LogLevel, LogLine, type SyncClient } from "sync-client"; +import type { LogLine } from "sync-client"; +import { LogLevel, type SyncClient } from "sync-client"; export class LogsView extends ItemView { public static readonly TYPE = "logs-view"; public static readonly ICON = "logs"; private logsContainer: HTMLElement | undefined; - private logLineToElement: Map = new Map(); + private readonly logLineToElement = new Map(); public constructor( private readonly client: SyncClient, diff --git a/frontend/sync-client/src/services/sync-reset-error.ts b/frontend/sync-client/src/services/sync-reset-error.ts index d1aa2eb6..5e27dfb6 100644 --- a/frontend/sync-client/src/services/sync-reset-error.ts +++ b/frontend/sync-client/src/services/sync-reset-error.ts @@ -1,5 +1,5 @@ export class SyncResetError extends Error { - constructor() { + public constructor() { super("Sync was reset"); this.name = "SyncResetError"; } diff --git a/frontend/sync-client/src/services/sync-service.ts b/frontend/sync-client/src/services/sync-service.ts index 6684428f..0b3fcba3 100644 --- a/frontend/sync-client/src/services/sync-service.ts +++ b/frontend/sync-client/src/services/sync-service.ts @@ -70,7 +70,7 @@ export class SyncService { relativePath: RelativePath; contentBytes: Uint8Array; }): Promise { - const vaultName = this.settings.getSettings().vaultName; + const { vaultName } = this.settings.getSettings(); return this.withRetries(async () => { const formData = new FormData(); @@ -123,7 +123,7 @@ export class SyncService { relativePath: RelativePath; contentBytes: Uint8Array; }): Promise { - const vaultName = this.settings.getSettings().vaultName; + const { vaultName } = this.settings.getSettings(); return this.withRetries(async () => { this.logger.debug( @@ -175,7 +175,7 @@ export class SyncService { relativePath: RelativePath; }): Promise { return this.withRetries(async () => { - const vaultName = this.settings.getSettings().vaultName; + const { vaultName } = this.settings.getSettings(); const response = await this.client.DELETE( "/vaults/{vault_id}/documents/{document_id}", @@ -212,7 +212,7 @@ export class SyncService { }: { documentId: DocumentId; }): Promise { - const vaultName = this.settings.getSettings().vaultName; + const { vaultName } = this.settings.getSettings(); return this.withRetries(async () => { const response = await this.client.GET( @@ -248,7 +248,7 @@ export class SyncService { since?: VaultUpdateId ): Promise { return this.withRetries(async () => { - const vaultName = this.settings.getSettings().vaultName; + const { vaultName } = this.settings.getSettings(); const response = await this.client.GET( "/vaults/{vault_id}/documents",