File tree Expand file tree Collapse file tree 3 files changed +23
-12
lines changed
Expand file tree Collapse file tree 3 files changed +23
-12
lines changed Original file line number Diff line number Diff line change 7070 <div class =" h-100 all-center" v-else >
7171 <div >
7272 <img
73- src =" https://cb-thumbnails.s3.ap-south-1.amazonaws.com/select-track-removebg-preview.png"
73+ src =" https://minio.codingblocks.com/amoeba/online-loader.gif"
74+ alt =" loading..."
7475 />
75- <div class =" heading-5 t-align-c bold text-gradient-orange mt-10" >
76- PLEASE SELECT A TRACK TO GET GOING!
77- </div >
7876 </div >
7977 </div >
8078</template >
8381import RatingsComponent from ' @/components/misc/RatingsComponent.vue'
8482
8583export default {
86- props: [' id' ],
84+ props: {
85+ id: {
86+ type: String ,
87+ default: 1 ,
88+ },
89+ },
8790 components: {
8891 RatingsComponent,
8992 },
9093 data () {
9194 return {
9295 track: null ,
9396 courses: [],
97+ loading: false ,
9498 }
9599 },
96100 watch: {
97- id : async function (val ) {
98- let response = await this .$repositories .courses .fetchTrackById (val ?? 1 )
99- this .track = response
100-
101- response = await this .$repositories .courses .fetchCourseForTrack (val ?? 1 )
102- this .courses = response
101+ id: {
102+ async handler (newVal , oldVal ) {
103+ this .loading = true
104+ this .track = null
105+ let [track, courses] = await Promise .all ([
106+ this .$repositories .courses .fetchTrackById (newVal?? 1 ),
107+ this .$repositories .courses .fetchCourseForTrack (newVal?? 1 ),
108+ ])
109+ this .track = track
110+ this .courses = courses
111+ this .loading = false
112+ },
113+ immediate: true ,
103114 },
104115 },
105116}
Original file line number Diff line number Diff line change 6868 </div >
6969 <div v-else class =" position-relative tooltip-container" >
7070 <button class =" button-primary" @click =" handleRegister" >
71- Register using Oneauth
71+ Register
7272 <img
7373 src =" https://cb-thumbnails.s3.ap-south-1.amazonaws.com/button-icon.svg"
7474 class =" ml-2"
You can’t perform that action at this time.
0 commit comments