mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-05 08:52:30 +00:00
- Delete items which are no longer used that might cause potential problems
- Fix Some Imports - Fix floating promises on tests
This commit is contained in:
@@ -30,7 +30,7 @@ import { LOG_LEVEL_NOTICE, setGlobalLogFunction } from "octagonal-wheels/common/
|
|||||||
import { LogPaneView, VIEW_TYPE_LOG } from "./Log/LogPaneView.ts";
|
import { LogPaneView, VIEW_TYPE_LOG } from "./Log/LogPaneView.ts";
|
||||||
import { serialized } from "octagonal-wheels/concurrency/lock";
|
import { serialized } from "octagonal-wheels/concurrency/lock";
|
||||||
import { $msg } from "src/lib/src/common/i18n.ts";
|
import { $msg } from "src/lib/src/common/i18n.ts";
|
||||||
import { P2PLogCollector } from "../../lib/src/replication/trystero/P2PReplicatorCore.ts";
|
import { P2PLogCollector } from "@/lib/src/replication/trystero/P2PLogCollector.ts";
|
||||||
import type { LiveSyncCore } from "../../main.ts";
|
import type { LiveSyncCore } from "../../main.ts";
|
||||||
import { LiveSyncError } from "@lib/common/LSError.ts";
|
import { LiveSyncError } from "@lib/common/LSError.ts";
|
||||||
import { isValidPath } from "@/common/utils.ts";
|
import { isValidPath } from "@/common/utils.ts";
|
||||||
|
|||||||
@@ -106,10 +106,10 @@ export class ModuleLiveSyncMain extends AbstractModule {
|
|||||||
this._log($msg("moduleLiveSyncMain.logReadChangelog"), LOG_LEVEL_NOTICE);
|
this._log($msg("moduleLiveSyncMain.logReadChangelog"), LOG_LEVEL_NOTICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//@ts-ignore
|
// //@ts-ignore
|
||||||
if (this.isMobile) {
|
// if (this.isMobile) {
|
||||||
this.settings.disableRequestURI = true;
|
// this.settings.disableRequestURI = true;
|
||||||
}
|
// }
|
||||||
if (last_version && Number(last_version) < VER) {
|
if (last_version && Number(last_version) < VER) {
|
||||||
this.settings.liveSync = false;
|
this.settings.liveSync = false;
|
||||||
this.settings.syncOnSave = false;
|
this.settings.syncOnSave = false;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ describe("setupObsidian/setupManagerHandlers", () => {
|
|||||||
|
|
||||||
it("openSetupURI should delegate to SetupManager.onUseSetupURI", async () => {
|
it("openSetupURI should delegate to SetupManager.onUseSetupURI", async () => {
|
||||||
const setupManager = {
|
const setupManager = {
|
||||||
onUseSetupURI: vi.fn(async () => true),
|
onUseSetupURI: vi.fn(async () => await Promise.resolve(true)),
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
await openSetupURI(setupManager);
|
await openSetupURI(setupManager);
|
||||||
@@ -37,7 +37,7 @@ describe("setupObsidian/setupManagerHandlers", () => {
|
|||||||
},
|
},
|
||||||
} as any;
|
} as any;
|
||||||
const setupManager = {
|
const setupManager = {
|
||||||
onP2PManualSetup: vi.fn(async () => true),
|
onP2PManualSetup: vi.fn(async () => await Promise.resolve(true)),
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
await openP2PSettings(host, setupManager);
|
await openP2PSettings(host, setupManager);
|
||||||
@@ -65,8 +65,8 @@ describe("setupObsidian/setupManagerHandlers", () => {
|
|||||||
},
|
},
|
||||||
} as any;
|
} as any;
|
||||||
const setupManager = {
|
const setupManager = {
|
||||||
onUseSetupURI: vi.fn(async () => true),
|
onUseSetupURI: vi.fn(async () => await Promise.resolve(true)),
|
||||||
onP2PManualSetup: vi.fn(async () => true),
|
onP2PManualSetup: vi.fn(async () => await Promise.resolve(true)),
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
useSetupManagerHandlersFeature(host, setupManager);
|
useSetupManagerHandlersFeature(host, setupManager);
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ describe("setupObsidian/setupProtocol", () => {
|
|||||||
} as any;
|
} as any;
|
||||||
const log = vi.fn();
|
const log = vi.fn();
|
||||||
const setupManager = {
|
const setupManager = {
|
||||||
onUseSetupURI: vi.fn(async () => true),
|
onUseSetupURI: vi.fn(async () => await Promise.resolve(true)),
|
||||||
decodeQR: vi.fn(async () => true),
|
decodeQR: vi.fn(async () => await Promise.resolve(true)),
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
registerSetupProtocolHandler(host, log, setupManager);
|
registerSetupProtocolHandler(host, log, setupManager);
|
||||||
@@ -67,8 +67,8 @@ describe("setupObsidian/setupProtocol", () => {
|
|||||||
} as any;
|
} as any;
|
||||||
const log = vi.fn();
|
const log = vi.fn();
|
||||||
const setupManager = {
|
const setupManager = {
|
||||||
onUseSetupURI: vi.fn(async () => true),
|
onUseSetupURI: vi.fn(async () => await Promise.resolve(true)),
|
||||||
decodeQR: vi.fn(async () => true),
|
decodeQR: vi.fn(async () => await Promise.resolve(true)),
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
registerSetupProtocolHandler(host, log, setupManager);
|
registerSetupProtocolHandler(host, log, setupManager);
|
||||||
|
|||||||
Reference in New Issue
Block a user