From 90e9480b92411373f4efba9884208a924a4d9fe8 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 16 Aug 2024 14:41:04 +0100 Subject: [PATCH] fix `offestMode` in `MkPagination` - fixes #622 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3f73251df5967ad47f61f1a6541f9d5ff6563f72 reworked the way `offsetMode` is handled, to allow reactive `ComputedRef` in addition to a simple `boolean`, so that custom emoji search could easily switch between the faster `sinceId`/`untilId` pagination and the slower `offset` as needed. Or it would have, if I had written the correct expression! I wrote `props.offsetMode` instead of `props.pagination.offsetMode`, so it was always `false` I have *no idea* how I didn't notice, I swear I tested it ☹ Anyway, factoring out the nested ternaries makes the whole thing clearer and less prone to mistakes. And I have tested it, this time. --- .../frontend/src/components/MkPagination.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/frontend/src/components/MkPagination.vue b/packages/frontend/src/components/MkPagination.vue index 9a324849e2..4f2a4d2703 100644 --- a/packages/frontend/src/components/MkPagination.vue +++ b/packages/frontend/src/components/MkPagination.vue @@ -43,7 +43,7 @@ SPDX-License-Identifier: AGPL-3.0-only