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

Function maybeCleanupSession

src/native_pdf_export_patch.ts:149–166  ·  view source on GitHub ↗
(session: NativeExportSession, reason: string)

Source from the content-addressed store, hash-verified

147}
148
149function maybeCleanupSession(session: NativeExportSession, reason: string) {
150 if (activeNativeExportSession !== session) {
151 return;
152 }
153
154 if (shouldKeepSessionAlive(session)) {
155 debugNativePdf(session, "session kept alive", {
156 reason,
157 liveTrackedModal: hasLiveTrackedModal(session),
158 popupObserverCount: session.popupCleanups.size,
159 popupOpened: session.popupOpened,
160 });
161 return;
162 }
163
164 debugNativePdf(session, "session eligible for cleanup", { reason });
165 session.cleanup();
166}
167
168function installPopupPrintObserver(
169 session: NativeExportSession,

Callers 2

cleanupFunction · 0.85
refreshTrackedModalsFunction · 0.85

Calls 3

shouldKeepSessionAliveFunction · 0.85
debugNativePdfFunction · 0.85
hasLiveTrackedModalFunction · 0.85

Tested by

no test coverage detected