fix: notes page_count change not working
This commit is contained in:
parent
1d4040a774
commit
e74647c225
@ -362,6 +362,7 @@ function updatePageLength(value, loadMore = false) {
|
|||||||
if (loadMore) {
|
if (loadMore) {
|
||||||
list.value.params.page_length += list.value.params.page_length_count
|
list.value.params.page_length += list.value.params.page_length_count
|
||||||
} else {
|
} 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 = value
|
||||||
list.value.params.page_length_count = value
|
list.value.params.page_length_count = value
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,7 +80,6 @@
|
|||||||
totalCount: notes.data.total_count,
|
totalCount: notes.data.total_count,
|
||||||
}"
|
}"
|
||||||
@loadMore="() => loadMore++"
|
@loadMore="() => loadMore++"
|
||||||
@updatePageCount="(count) => (updatedPageCount = count)"
|
|
||||||
/>
|
/>
|
||||||
<div v-else class="flex h-full items-center justify-center">
|
<div v-else class="flex h-full items-center justify-center">
|
||||||
<div
|
<div
|
||||||
@ -106,6 +105,7 @@ import UserAvatar from '@/components/UserAvatar.vue'
|
|||||||
import NoteIcon from '@/components/Icons/NoteIcon.vue'
|
import NoteIcon from '@/components/Icons/NoteIcon.vue'
|
||||||
import NoteModal from '@/components/Modals/NoteModal.vue'
|
import NoteModal from '@/components/Modals/NoteModal.vue'
|
||||||
import ViewControls from '@/components/ViewControls.vue'
|
import ViewControls from '@/components/ViewControls.vue'
|
||||||
|
import { usersStore } from '@/stores/users'
|
||||||
import { timeAgo, dateFormat, dateTooltipFormat } from '@/utils'
|
import { timeAgo, dateFormat, dateTooltipFormat } from '@/utils'
|
||||||
import {
|
import {
|
||||||
TextEditor,
|
TextEditor,
|
||||||
@ -115,8 +115,7 @@ import {
|
|||||||
Breadcrumbs,
|
Breadcrumbs,
|
||||||
ListFooter,
|
ListFooter,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
import { ref } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import { usersStore } from '@/stores/users'
|
|
||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
|
|
||||||
@ -135,6 +134,14 @@ const notes = ref({})
|
|||||||
const loadMore = ref(1)
|
const loadMore = ref(1)
|
||||||
const updatedPageCount = ref(20)
|
const updatedPageCount = ref(20)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => notes.value?.data?.page_length_count,
|
||||||
|
(val, old_value) => {
|
||||||
|
if (!val || val === old_value) return
|
||||||
|
updatedPageCount.value = val
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
function createNote() {
|
function createNote() {
|
||||||
currentNote.value = {
|
currentNote.value = {
|
||||||
title: '',
|
title: '',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user