MCPcopy Create free account
hub / github.com/JamesAC42/hanbok / initialize

Method initialize

app/src/lib/studySessionManager.js:29–48  ·  view source on GitHub ↗

* Initialize the study session with data from the server * @param {Object} sessionData - The session data from the API * @param {Function} updateCallback - Function to call when session state changes * @param {Object} deckSettings - The deck settings

(sessionData, updateCallback, deckSettings)

Source from the content-addressed store, hash-verified

27 * @param {Object} deckSettings - The deck settings
28 */
29 initialize(sessionData, updateCallback, deckSettings) {
30 this.session = sessionData;
31 this.updateCallback = updateCallback;
32 this.cardIndex = 0;
33 this.deckSettings = deckSettings || {
34 steps: [1, 10, 60, 1440], // Default steps in minutes
35 newCardsPerDay: 20,
36 reviewsPerDay: 100
37 };
38
39 if (sessionData && sessionData.deckId) {
40 this.deckId = sessionData.deckId;
41 }
42
43 if (this.hasCards()) {
44 this.currentCard = this.session.cards[0];
45 }
46
47 return this.currentCard;
48 }
49
50 /**
51 * Check if there are any cards to study

Callers 2

initializeGoogleSignInFunction · 0.80
fetchDeckDetailsFunction · 0.80

Calls 1

hasCardsMethod · 0.95

Tested by

no test coverage detected