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

Method onJoinClassroomSuccess

app/views/courses/CoursesView.js:685–707  ·  view source on GitHub ↗
(newClassroom, data, options)

Source from the content-addressed store, hash-verified

683 }
684
685 onJoinClassroomSuccess (newClassroom, data, options) {
686 this.state = null
687 if (application.tracker != null) {
688 application.tracker.trackEvent('Joined classroom', {
689 category: 'Courses',
690 classCode: this.classCode,
691 classroomID: newClassroom.id,
692 classroomName: newClassroom.get('name'),
693 ownerID: newClassroom.get('ownerID'),
694 })
695 }
696 this.classrooms.add(newClassroom)
697 this.render()
698 this.classroomJustAdded = newClassroom.id
699
700 const classroomCourseInstances = new CocoCollection([], { url: '/db/course_instance', model: CourseInstance })
701 classroomCourseInstances.fetch({ data: { classroomID: newClassroom.id } })
702 return this.listenToOnce(classroomCourseInstances, 'sync', () => {
703 // TODO: Smoother system for joining a classroom and course instances, without requiring page reload,
704 // and showing which class was just joined.
705 document.location.search = ''
706 }) // Using document.location.reload() causes an infinite loop of reloading
707 }
708
709 nextLevelUrl () {
710 if (!this.nextLevelInfo) { return null }

Callers 1

joinClassMethod · 0.95

Calls 4

fetchMethod · 0.95
trackEventMethod · 0.45
getMethod · 0.45
renderMethod · 0.45

Tested by

no test coverage detected