This repository was archived by the owner on Sep 25, 2025. It is now read-only.
Repository navigation
Conversation
👇 Click on the image for a new way to code review
Legend |
Sboonny
commented
Jan 31, 2023
Comment on lines
-57
to
-65
| cache: new InMemoryCache({ | ||
| typePolicies: { | ||
| Query: { | ||
| fields: { | ||
| paginatedEvents: offsetLimitPagination(), | ||
| }, | ||
| }, | ||
| }, | ||
| }), |
Member
Author
There was a problem hiding this comment.
needed to delete this, because the data doesn't exist?
in policies.d.ts
export declare type FieldReadFunction<TExisting = any, TReadResult = TExisting, TOptions extends FieldFunctionOptions = FieldFunctionOptions> = (existing: SafeReadonly<TExisting> | undefined, options: TOptions) => TReadResult | undefined;
Sboonny
commented
Jan 31, 2023
| variables: { offset: data?.paginatedEventsWithTotal.length }, | ||
| }); | ||
| setHasMore(res.data.paginatedEvents.length > 0); | ||
| setHasMore(res.data.paginatedEventsWithTotal.length > 0); |
Member
Author
There was a problem hiding this comment.
I have to many possibilities, while knowing the values are always 2 and 7. BTW, did you know, you can't mutate them, I didn't.
const total = data?.paginatedEventsWithTotal.map(({total})=> total).reduce(Number)
setHasMore(res.data.paginatedEventsWithTotal.length < total)
setHasMore(res.data.paginatedEventsWithTotal.length > total);
setHasMore(res.data.paginatedEventsWithTotal.length + 2 < total)
setHasMore(res.data.paginatedEventsWithTotal.length + 2 > total)
setHasMore(res.data.paginatedEventsWithTotal.length += 2 < total)
setHasMore(res.data.paginatedEventsWithTotal.length += 2 < total)
```
Sboonny
commented
Jan 31, 2023
Comment on lines
+69
to
+72
| const lookIfDataExist = | ||
| res.data.paginatedEventsWithTotal.length === | ||
| data?.paginatedEventsWithTotal.length; | ||
| setHasMore(lookIfDataExist); |
Member
Author
There was a problem hiding this comment.
If the total is odd, it will hide the odd number, although people won't know, it is still a bug, and maybe it doesn't work if the events are even, but I have no idea how to fix it.
Sboonny
commented
Jan 31, 2023
Sboonny
marked this pull request as ready for review
January 31, 2023 16:58
Sboonny
commented
Jan 31, 2023
Sboonny
marked this pull request as draft
February 4, 2023 17:25
Sboonny
force-pushed
the
feat/hide-hasmore-button-when-there-is-no-events
branch
from
February 5, 2023 07:43
c9b03c2 to
5115d4b
Compare
Sboonny
force-pushed
the
feat/hide-hasmore-button-when-there-is-no-events
branch
from
February 5, 2023 07:44
5115d4b to
f82f9e1
Compare
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Update README.md).mainbranch of Chapter.I am trying to observe the data, and hide the data based on if there is more data or not, and when it's complete and there is no more data, we can hide the buttons, instead of running the function again to findout if there is data left.