MCPcopy Create free account
hub / github.com/codecombat/codecombat / getLatestCookieConsent

Method getLatestCookieConsent

app/models/User.js:738–747  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

736 }
737
738 getLatestCookieConsent () {
739 // Get the most recent cookie consent from consentHistory
740 const consentHistory = this.get('consentHistory') || []
741 const cookieConsents = consentHistory.filter(c => c.type === 'cookies')
742 if (cookieConsents.length === 0) {
743 return null
744 }
745 // Return the most recent one using _.max with custom iterator
746 return _.max(cookieConsents, c => new Date(c.date).getTime())
747 }
748
749 tryStartExperiment (name) {
750 let probability = window.serverConfig?.experimentProbabilities?.[name]?.beta

Callers 1

Calls 2

getMethod · 0.95
filterMethod · 0.80

Tested by

no test coverage detected