diff --git a/client/src/components/Chapter.vue b/client/src/components/Chapter.vue index 14366295..b5fd26db 100644 --- a/client/src/components/Chapter.vue +++ b/client/src/components/Chapter.vue @@ -8,7 +8,7 @@ @edit-note="editNote" :bookmarked="chapter.bookmark" @bookmark="bookmark(!chapter.bookmark)" - :note="chapter.bookmark.note" + :note="note" >

{{chapter.description}} @@ -58,6 +58,12 @@ schoolClass() { return this.me.selectedClass; }, + note() { + if (!(this.chapter && this.chapter.bookmark)) { + return; + } + return this.chapter.bookmark.note; + } }, data() { @@ -77,7 +83,7 @@ bookmarked } }, - update: (store, response) => { + update: (store, response) => { const query = CHAPTER_QUERY; const variables = {id}; const data = store.readQuery({ diff --git a/client/src/components/modules/Module.vue b/client/src/components/modules/Module.vue index 6e9b5534..7805b237 100644 --- a/client/src/components/modules/Module.vue +++ b/client/src/components/modules/Module.vue @@ -12,7 +12,7 @@ @add-note="addNote" @edit-note="editNote" :bookmarked="module.bookmark" - :note="module.bookmark.note" + :note="note" @bookmark="bookmark(!module.bookmark)">

@@ -81,6 +81,12 @@ }, isStudent() { return !this.me.permissions.includes('users.can_manage_school_class_content'); + }, + note() { + if (!(this.module && this.module.bookmark)) { + return; + } + return this.module.bookmark.note; } },