Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
cb2e1ae3
Unverified
Commit
cb2e1ae3
authored
Oct 26, 2022
by
boojack
Committed by
GitHub
Oct 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fetch memo with filter (#346)
parent
9705406b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
MemoList.tsx
web/src/components/MemoList.tsx
+9
-0
location.ts
web/src/store/modules/location.ts
+2
-1
No files found.
web/src/components/MemoList.tsx
View file @
cb2e1ae3
...
@@ -103,6 +103,15 @@ const MemoList = () => {
...
@@ -103,6 +103,15 @@ const MemoList = () => {
}
}
}
, [query]);
}
, [query]);
useEffect(() =
>
{
if
(
isFetching
||
isComplete
)
{
return
;
}
if
(
sortedMemos
.
length
<
DEFAULT_MEMO_LIMIT
)
{
handleFetchMoreClick
();
}
}
, [isFetching, isComplete, query, sortedMemos.length]);
const handleFetchMoreClick = async () =
>
{
const handleFetchMoreClick = async () =
>
{
try
{
try
{
const
fetchedMemos
=
await
memoService
.
fetchMemos
(
DEFAULT_MEMO_LIMIT
,
memos
.
length
);
const
fetchedMemos
=
await
memoService
.
fetchMemos
(
DEFAULT_MEMO_LIMIT
,
memos
.
length
);
...
...
web/src/store/modules/location.ts
View file @
cb2e1ae3
...
@@ -42,7 +42,8 @@ const getStateFromLocation = () => {
...
@@ -42,7 +42,8 @@ const getStateFromLocation = () => {
state
.
query
.
tag
=
urlParams
.
get
(
"tag"
)
??
undefined
;
state
.
query
.
tag
=
urlParams
.
get
(
"tag"
)
??
undefined
;
state
.
query
.
type
=
(
urlParams
.
get
(
"type"
)
as
MemoSpecType
)
??
undefined
;
state
.
query
.
type
=
(
urlParams
.
get
(
"type"
)
as
MemoSpecType
)
??
undefined
;
state
.
query
.
text
=
urlParams
.
get
(
"text"
)
??
undefined
;
state
.
query
.
text
=
urlParams
.
get
(
"text"
)
??
undefined
;
state
.
query
.
shortcutId
=
Number
(
urlParams
.
get
(
"shortcutId"
))
??
undefined
;
const
shortcutIdStr
=
urlParams
.
get
(
"shortcutId"
);
state
.
query
.
shortcutId
=
shortcutIdStr
?
Number
(
shortcutIdStr
)
:
undefined
;
const
from
=
parseInt
(
urlParams
.
get
(
"from"
)
??
"0"
);
const
from
=
parseInt
(
urlParams
.
get
(
"from"
)
??
"0"
);
const
to
=
parseInt
(
urlParams
.
get
(
"to"
)
??
"0"
);
const
to
=
parseInt
(
urlParams
.
get
(
"to"
)
??
"0"
);
if
(
to
>
from
&&
to
!==
0
)
{
if
(
to
>
from
&&
to
!==
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment