diff --git a/courseware/vueapp/components/CoursewareVideoTable.vue b/courseware/vueapp/components/CoursewareVideoTable.vue
index 86d43794..6590d9f8 100644
--- a/courseware/vueapp/components/CoursewareVideoTable.vue
+++ b/courseware/vueapp/components/CoursewareVideoTable.vue
@@ -65,10 +65,6 @@
-
-
diff --git a/courseware/vueapp/courseware-plugin-opencast-video.vue b/courseware/vueapp/courseware-plugin-opencast-video.vue
index cac87b2b..40e25182 100644
--- a/courseware/vueapp/courseware-plugin-opencast-video.vue
+++ b/courseware/vueapp/courseware-plugin-opencast-video.vue
@@ -13,8 +13,8 @@
-
-
+
+
@@ -61,6 +65,7 @@
const get = window._.get.bind(window._);
import axios from 'axios';
import { mapActions, mapGetters } from 'vuex';
+import LtiAuth from "./components/LtiAuth.vue";
import CoursewareSearchBar from './components/CoursewareSearchBar.vue';
import CoursewareVideoTable from './components/CoursewareVideoTable.vue';
@@ -68,6 +73,7 @@ export default {
name: "courseware-plugin-opencast-video",
components: {
+ LtiAuth,
CoursewareSearchBar,
CoursewareVideoTable,
},
@@ -105,7 +111,7 @@ export default {
lastPage: 0,
items: 0
},
- videos: {},
+ videos: [],
loadingVideos : false,
currentVideoId : null,
currentEpisodeURL : null,
@@ -130,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;
}
},
@@ -256,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);
});
},
},