MCPcopy Create free account
hub / github.com/bjsi/incremental-everything / tryOpen

Function tryOpen

src/lib/queue_session.ts:519–532  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

517 const isFinalDrillActive = await plugin.storage.getSession<boolean>('finalDrillActive');
518 const lastHeartbeat = await plugin.storage.getSession<number>('finalDrillHeartbeat');
519 const isFresh = lastHeartbeat && Date.now() - lastHeartbeat < 4000;
520 scopeName = isFinalDrillActive || isFresh ? 'Mastery Drill' : 'Ad-hoc Session';
521 }
522
523 currentSession = {
524 id: Math.random().toString(36).substring(7),
525 startTime: Date.now(),
526 kbId: kbData._id,
527 queueId: isValidId ? queueId : undefined,
528 scopeName,
529 totalTime: 0,
530 flashcardsCount: 0,
531 flashcardsTime: 0,
532 incRemsCount: 0,
533 incRemsTime: 0,
534 againCount: 0,
535 currentCardFirstRep: undefined,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected