From ebc9e1a8889bae5304b4cbf2cb8f2e2ed65cdee7 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 23 Apr 2022 17:17:05 -0500 Subject: [PATCH] Fix batch mark as finished and clear selection #490 --- client/components/app/Appbar.vue | 1 + client/components/app/BookShelfRow.vue | 5 +++++ client/components/app/LazyBookshelf.vue | 3 --- server/routers/ApiRouter.js | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/components/app/Appbar.vue b/client/components/app/Appbar.vue index 832df9fc..2aab2ef9 100644 --- a/client/components/app/Appbar.vue +++ b/client/components/app/Appbar.vue @@ -166,6 +166,7 @@ export default { isFinished: newIsFinished } }) + console.log('Progress payloads', updateProgressPayloads) this.$axios .patch(`/api/me/progress/batch/update`, updateProgressPayloads) .then(() => { diff --git a/client/components/app/BookShelfRow.vue b/client/components/app/BookShelfRow.vue index ea478c1e..d402b90e 100644 --- a/client/components/app/BookShelfRow.vue +++ b/client/components/app/BookShelfRow.vue @@ -94,6 +94,9 @@ export default { } }, methods: { + clearSelectedEntities() { + this.updateSelectionMode(false) + }, editAuthor(author) { this.selectedAuthor = author this.showAuthorModal = true @@ -181,9 +184,11 @@ export default { } }, mounted() { + this.$eventBus.$on('bookshelf-clear-selection', this.clearSelectedEntities) this.$eventBus.$on('item-selected', this.itemSelectedEvt) }, beforeDestroy() { + this.$eventBus.$off('bookshelf-clear-selection', this.clearSelectedEntities) this.$eventBus.$off('item-selected', this.itemSelectedEvt) } } diff --git a/client/components/app/LazyBookshelf.vue b/client/components/app/LazyBookshelf.vue index 5659a750..797d08e6 100644 --- a/client/components/app/LazyBookshelf.vue +++ b/client/components/app/LazyBookshelf.vue @@ -61,7 +61,6 @@ export default { totalShelves: 0, bookshelfMarginLeft: 0, isSelectionMode: false, - isSelectAll: false, currentSFQueryString: null, pendingReset: false, keywordFilter: null, @@ -217,7 +216,6 @@ export default { clearSelectedEntities() { this.updateBookSelectionMode(false) this.isSelectionMode = false - this.isSelectAll = false }, selectEntity(entity) { if (this.entityName === 'books' || this.entityName === 'series-books') { @@ -339,7 +337,6 @@ export default { this.totalEntities = 0 this.currentPage = 0 this.isSelectionMode = false - this.isSelectAll = false this.initialized = false this.initSizeData() diff --git a/server/routers/ApiRouter.js b/server/routers/ApiRouter.js index 81ee6b73..65062336 100644 --- a/server/routers/ApiRouter.js +++ b/server/routers/ApiRouter.js @@ -126,10 +126,10 @@ class ApiRouter { // this.router.get('/me/listening-sessions', MeController.getListeningSessions.bind(this)) this.router.get('/me/listening-stats', MeController.getListeningStats.bind(this)) + this.router.patch('/me/progress/batch/update', MeController.batchUpdateMediaProgress.bind(this)) this.router.patch('/me/progress/:id', MeController.createUpdateMediaProgress.bind(this)) this.router.delete('/me/progress/:id', MeController.removeMediaProgress.bind(this)) this.router.patch('/me/progress/:id/:episodeId', MeController.createUpdateEpisodeMediaProgress.bind(this)) - this.router.patch('/me/progress/batch/update', MeController.batchUpdateMediaProgress.bind(this)) this.router.post('/me/item/:id/bookmark', MeController.createBookmark.bind(this)) this.router.patch('/me/item/:id/bookmark', MeController.updateBookmark.bind(this)) this.router.delete('/me/item/:id/bookmark/:time', MeController.removeBookmark.bind(this))