MCPcopy Create free account
hub / github.com/UNLINEARITY/Obsidian-CodeSpace / refreshTrackedModals

Function refreshTrackedModals

src/native_pdf_export_patch.ts:442–462  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

440 };
441
442 const refreshTrackedModals = () => {
443 const currentModals = Array.from(ownerDoc.querySelectorAll<HTMLElement>(EXPORT_MODAL_SELECTOR));
444 for (const modal of currentModals) {
445 if (!session.knownModals.has(modal)) {
446 session.trackedModals.add(modal);
447 }
448 }
449
450 if (session.trackedModals.size > 0) {
451 session.sawTrackedModal = true;
452 debugNativePdf(session, "detected export modal lifecycle", {
453 trackedModalCount: session.trackedModals.size,
454 });
455 }
456
457 if (session.sawTrackedModal) {
458 if (!hasLiveTrackedModal(session)) {
459 maybeCleanupSession(session, "export modal closed");
460 }
461 }
462 };
463
464 session.cleanup = cleanup;
465 session.timeoutId = docWindow.setTimeout(cleanup, EXPORT_SESSION_TTL_MS);

Callers 1

beginNativeExportSessionFunction · 0.85

Calls 3

debugNativePdfFunction · 0.85
hasLiveTrackedModalFunction · 0.85
maybeCleanupSessionFunction · 0.85

Tested by

no test coverage detected