MCPcopy Index your code
hub / github.com/codecombat/codecombat / loadLeague

Method loadLeague

app/views/ladder/LadderView.js:233–246  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

231 }
232
233 loadLeague () {
234 if (!['clan', 'course'].includes(this.leagueType)) { this.leagueID = (this.leagueType = null) }
235 if (!this.leagueID) { return }
236
237 const modelClass = this.leagueType === 'clan' ? Clan : CourseInstance
238 this.league = this.supermodel.loadModel(new modelClass({ _id: this.leagueID })).model
239 if (this.leagueType === 'course') {
240 if (this.league.loaded) {
241 return this.onCourseInstanceLoaded(this.league)
242 } else {
243 return this.listenToOnce(this.league, 'sync', this.onCourseInstanceLoaded)
244 }
245 }
246 }
247
248 checkTournamentClose () {
249 if (this.tournamentId == null) { return }

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected