mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-11-05 15:58:19 +00:00
Expose NFC path identity across supported transports
This commit is contained in:
1 parent
0e458e5e20
commit
ca4e6d38b9
22 files changed
+1003
-268
No files matched your search
@@ -34,6 +34,7 @@ export type RemoteActivitySnapshot = {
|
||||
responseCount: number;
|
||||
statusBarFound: boolean;
|
||||
statusBarText: string;
|
||||
indicatorElements?: Array<{ text: string; inactive: boolean; ariaHidden: string | null; display: string }>;
|
||||
};
|
||||
|
||||
export type ExpectedRemoteActivityState =
|
||||
@@ -88,14 +89,26 @@ async function readRemoteActivitySnapshotFromPage(page: Page): Promise<RemoteAct
|
||||
gateKind: gate?.kind,
|
||||
requestCount: Number(core.services?.API?.requestCount?.value ?? -1),
|
||||
remoteOperationIndicatorVisible: statusBars.some((element) =>
|
||||
(element.textContent ?? "").includes(operationIcon)
|
||||
),
|
||||
remoteRequestIndicatorVisible: statusBars.some((element) =>
|
||||
(element.textContent ?? "").includes(requestIcon)
|
||||
element.innerText.includes(operationIcon)
|
||||
),
|
||||
remoteRequestIndicatorVisible: statusBars.some((element) => element.innerText.includes(requestIcon)),
|
||||
responseCount: Number(core.services?.API?.responseCount?.value ?? -1),
|
||||
statusBarFound: statusBars.length > 0,
|
||||
statusBarText: statusBars.map((element) => element.textContent ?? "").join("\n"),
|
||||
statusBarText: statusBars.map((element) => element.innerText).join("\n"),
|
||||
indicatorElements: Array.from(
|
||||
document.querySelectorAll<HTMLElement>(".syncstatusbar .livesync-stat-item")
|
||||
)
|
||||
.filter(
|
||||
(element) =>
|
||||
(element.textContent ?? "").includes(operationIcon) ||
|
||||
(element.textContent ?? "").includes(requestIcon)
|
||||
)
|
||||
.map((element) => ({
|
||||
text: element.textContent ?? "",
|
||||
inactive: element.classList.contains("livesync-stat-inactive"),
|
||||
ariaHidden: element.getAttribute("aria-hidden"),
|
||||
display: getComputedStyle(element).display,
|
||||
})),
|
||||
} satisfies RemoteActivitySnapshot;
|
||||
},
|
||||
{
|
||||
@@ -141,7 +154,7 @@ export async function waitForRemoteActivityState(
|
||||
if (!core) return false;
|
||||
const gate = (globalThis as unknown as Record<string, RuntimeGate | undefined>)[stateKey];
|
||||
const statusBarText = Array.from(document.querySelectorAll<HTMLElement>(".syncstatusbar"))
|
||||
.map((element) => element.textContent ?? "")
|
||||
.map((element) => element.innerText)
|
||||
.join("\n");
|
||||
const bounded = Number(core.services?.replicator?.boundedRemoteActivityCount?.value ?? -1);
|
||||
const finite = Number(core.services?.replicator?.finiteReplicationActivityCount?.value ?? -1);
|
||||
|
||||
Reference in new issue
Block a user