Skip to content

Commit 6c6e030

Browse files
add loader for tracks
1 parent 8e3de9f commit 6c6e030

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

.DS_Store

8 KB
Binary file not shown.

components/courses/TracksListComponent.vue

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,9 @@
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>
@@ -83,23 +81,36 @@
8381
import RatingsComponent from '@/components/misc/RatingsComponent.vue'
8482
8583
export 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
}

pages/events/_id/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
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"

0 commit comments

Comments
 (0)