From 64d802dece48e7ff4088535317c7f884f16fa9be Mon Sep 17 00:00:00 2001 From: Dennis Benz Date: Mon, 18 Nov 2024 11:42:55 +0100 Subject: [PATCH] Courseware: Show opencast connection error after lti check is performed --- .../courseware-plugin-opencast-video.vue | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/courseware/vueapp/courseware-plugin-opencast-video.vue b/courseware/vueapp/courseware-plugin-opencast-video.vue index 4610dbcf..40e25182 100644 --- a/courseware/vueapp/courseware-plugin-opencast-video.vue +++ b/courseware/vueapp/courseware-plugin-opencast-video.vue @@ -13,8 +13,8 @@
- - @@ -111,7 +111,7 @@ export default { lastPage: 0, items: 0 }, - videos: {}, + videos: [], loadingVideos : false, currentVideoId : null, currentEpisodeURL : null, @@ -136,15 +136,22 @@ export default { ); }, + currentVideo() { + return this.videos.find(video => video.token === this.currentVideoId); + }, + + isCurrentVideoLTIChecked() { + if (!this.currentVideo) { + return false; + } + return this.isLTIAuthenticated[this.currentVideo.config_id] !== undefined; + }, + isCurrentVideoLTIAuthenticated() { - if (this.videos.length > 0) { - let currentVideo = this.videos.find(video => video.token === this.currentVideoId); - if (!currentVideo) { - return false; - } - return this.isLTIAuthenticated[currentVideo.config_id]; + if (!this.currentVideo) { + return false; } - return false; + return this.isLTIAuthenticated[this.currentVideo.config_id] === true; } }, @@ -262,7 +269,11 @@ export default { }).then((response) => { if (response.status == 200 && response.data.user_id !== undefined) { this.$set(this.isLTIAuthenticated, server.id, true); + } else { + this.$set(this.isLTIAuthenticated, server.id, false); } + }).catch(() => { + this.$set(this.isLTIAuthenticated, server.id, false); }); }, },