From e74647c225ff5741f0aab4b167069511f1db3b3f Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 5 Feb 2024 13:52:44 +0530 Subject: [PATCH] fix: notes page_count change not working --- frontend/src/components/ViewControls.vue | 1 + frontend/src/pages/Notes.vue | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/ViewControls.vue b/frontend/src/components/ViewControls.vue index 504b8044..b18f7958 100644 --- a/frontend/src/components/ViewControls.vue +++ b/frontend/src/components/ViewControls.vue @@ -362,6 +362,7 @@ function updatePageLength(value, loadMore = false) { if (loadMore) { list.value.params.page_length += list.value.params.page_length_count } else { + if (value == list.value.params.page_length && value == list.value.params.page_length_count) return list.value.params.page_length = value list.value.params.page_length_count = value } diff --git a/frontend/src/pages/Notes.vue b/frontend/src/pages/Notes.vue index 1a38e3dd..e14b7eb3 100644 --- a/frontend/src/pages/Notes.vue +++ b/frontend/src/pages/Notes.vue @@ -80,7 +80,6 @@ totalCount: notes.data.total_count, }" @loadMore="() => loadMore++" - @updatePageCount="(count) => (updatedPageCount = count)" />
notes.value?.data?.page_length_count, + (val, old_value) => { + if (!val || val === old_value) return + updatedPageCount.value = val + } +) + function createNote() { currentNote.value = { title: '',