| 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 } |