Complete Commonlib rc.6 integration and setup workflows

This commit is contained in:
vorotamoroz
2026-07-21 15:00:28 +00:00
parent e005f9eb13
commit 1ef8c88139
150 changed files with 31041 additions and 260 deletions
+20
View File
@@ -0,0 +1,20 @@
import { ConnectionStringParser } from "@vrtmrz/livesync-commonlib/compat/common/ConnectionString";
import {
REMOTE_P2P,
type ObsidianLiveSyncSettings,
} from "@vrtmrz/livesync-commonlib/compat/common/types";
/** Returns whether the selected main remote represents the P2P-only setup. */
export function isP2PMainRemote(settings: ObsidianLiveSyncSettings): boolean {
if (settings.remoteType === REMOTE_P2P) return true;
const activeId = settings.activeConfigurationId?.trim();
const activeConfiguration = activeId ? settings.remoteConfigurations?.[activeId] : undefined;
if (!activeConfiguration) return false;
try {
return ConnectionStringParser.parse(activeConfiguration.uri).type === "p2p";
} catch {
return false;
}
}