paginate in offset mode when querying emoji - fixes #490

since the backend sorts emojis by name length when a query is present,
the normal pagination with `sinceId` / `untilId` would not work
reliably

`offsetMode` is better in this case, although it will produce
non-stable results if custom emojis that match the query are added or
removed while we paginate
This commit is contained in:
dakkar 2024-04-07 17:50:53 +01:00
parent 9d91196344
commit a676b0ee61

View file

@ -98,6 +98,9 @@ const selectedEmojis = ref<string[]>([]);
const pagination = {
endpoint: 'admin/emoji/list' as const,
limit: 30,
offsetMode: computed(() => (
(query.value && query.value !== '') ? true : false
)),
params: computed(() => ({
query: (query.value && query.value !== '') ? query.value : null,
})),