diff --git a/resources/vue/components/courseware/IndexApp.vue b/resources/vue/components/courseware/IndexApp.vue index c0facd5d2861e1d24c42a324125db701ea54d081..8fcda08ba0446ce3ef87fba718c97eef3630ba66 100644 --- a/resources/vue/components/courseware/IndexApp.vue +++ b/resources/vue/components/courseware/IndexApp.vue @@ -116,9 +116,20 @@ export default { return; } - await this.loadStructuralElement(id); - this.canVisit = this.structuralElementLastMeta['can-visit']; - this.selected = this.structuralElementById({ id }); + this.structureLoadingState = 'loading'; + try { + await this.loadStructuralElement(id); + } catch (error) { + this.loadingErrorStatus = error.status; + this.structureLoadingState = 'error'; + return; + } + + this.structureLoadingState = 'done'; + this.$nextTick( () => { + this.canVisit = this.structuralElementLastMeta['can-visit']; + this.selected = this.structuralElementById({ id }); + }); }, }, async mounted() {