Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
342
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
28
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TransFem.org
Sharkey
Commits
3f73251d
Commit
3f73251d
authored
11 months ago
by
dakkar
Browse files
Options
Downloads
Patches
Plain Diff
allow computed `offsetMode` in `MkPagination` -
#490
parent
f1d96b8a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!556
release 2024.5.0
,
!537
merge up to 2024.5.0
,
!489
fix custom emoji pagination when searching - fixes #490
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/frontend/src/components/MkPagination.vue
+5
-3
5 additions, 3 deletions
packages/frontend/src/components/MkPagination.vue
with
5 additions
and
3 deletions
packages/frontend/src/components/MkPagination.vue
+
5
−
3
View file @
3f73251d
...
...
@@ -73,7 +73,7 @@ export type Paging<E extends keyof Misskey.Endpoints = keyof Misskey.Endpoints>
*/
reversed
?:
boolean
;
offsetMode
?:
boolean
;
offsetMode
?:
boolean
|
ComputedRef
<
boolean
>
;
pageEl
?:
HTMLElement
;
};
...
...
@@ -240,10 +240,11 @@ const fetchMore = async (): Promise<void> => {
if
(
!
more
.
value
||
fetching
.
value
||
moreFetching
.
value
||
items
.
value
.
size
===
0
)
return
;
moreFetching
.
value
=
true
;
const
params
=
props
.
pagination
.
params
?
isRef
(
props
.
pagination
.
params
)
?
props
.
pagination
.
params
.
value
:
props
.
pagination
.
params
:
{};
const
offsetMode
=
props
.
offsetMode
?
isRef
(
props
.
offsetMode
)
?
props
.
offsetMode
.
value
:
props
.
offsetMode
:
false
;
await
misskeyApi
<
MisskeyEntity
[]
>
(
props
.
pagination
.
endpoint
,
{
...
params
,
limit
:
SECOND_FETCH_LIMIT
,
...(
props
.
pagination
.
offsetMode
?
{
...(
offsetMode
?
{
offset
:
offset
.
value
,
}
:
{
untilId
:
Array
.
from
(
items
.
value
.
keys
()).
at
(
-
1
),
...
...
@@ -304,10 +305,11 @@ const fetchMoreAhead = async (): Promise<void> => {
if
(
!
more
.
value
||
fetching
.
value
||
moreFetching
.
value
||
items
.
value
.
size
===
0
)
return
;
moreFetching
.
value
=
true
;
const
params
=
props
.
pagination
.
params
?
isRef
(
props
.
pagination
.
params
)
?
props
.
pagination
.
params
.
value
:
props
.
pagination
.
params
:
{};
const
offsetMode
=
props
.
offsetMode
?
isRef
(
props
.
offsetMode
)
?
props
.
offsetMode
.
value
:
props
.
offsetMode
:
false
;
await
misskeyApi
<
MisskeyEntity
[]
>
(
props
.
pagination
.
endpoint
,
{
...
params
,
limit
:
SECOND_FETCH_LIMIT
,
...(
props
.
pagination
.
offsetMode
?
{
...(
offsetMode
?
{
offset
:
offset
.
value
,
}
:
{
sinceId
:
Array
.
from
(
items
.
value
.
keys
()).
at
(
-
1
),
...
...
This diff is collapsed.
Click to expand it.
dakkar
@dakkar
mentioned in commit
90e9480b
·
6 months ago
mentioned in commit
90e9480b
mentioned in commit 90e9480b92411373f4efba9884208a924a4d9fe8
Toggle commit list
dakkar
@dakkar
mentioned in merge request
!599 (merged)
·
6 months ago
mentioned in merge request
!599 (merged)
mentioned in merge request !599
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment