Comments (5)
Thank you so much for a nice repro example. I can also see it's happening in our web-wagmi
example app (https://github.com/lens-protocol/lens-sdk/blob/main/examples/web-wagmi/src/publications/UsePublications.tsx) and seems to be a regression we introduced recently while adding the way to fetch previous items.
Will look into it with the team tomorrow and push a fix 🌿 .
from lens-sdk.
I've spent some time today on investigating this but I didn't find the issue.
- issue is present in
production
setting, but not indevelopment
orsandbox
(weird) createPublicationsFieldPolicy
callscursorBasedPagination
that sets correctlymoreAfter
field, it is present in apollo cache and I see it when read/merge functions all called from type policy- but apollo query when called as a hook
Apollo.useQuery
returns paginated result without additional @client only fields - any ideas?
from lens-sdk.
@melissafzhang - we identified the issue and released a patch as v1.1.1, could you please try and let us know if it works for you?
npm install @lens-protocol/[email protected]
from lens-sdk.
@krzysu thanks! Looks like it's fixed. Another small issue I noticed was that loading
never changes to true
when calling next
. Is that intended? Updated the code sandbo with an example.
from lens-sdk.
@melissafzhang its intended behaviour to not change loading
while fetching more data (either with next
or prev
).
The loading
flag only indicates the initial request to fetch the data and folks often use it in a following way:
function Publications() {
const { loading, data } = usePublications(...);
if (loading) {
return <PublicationsSkeleton />
}
return data.map(publication => <Publication publication={publication} />);
}
Changing the flag in the above scenario would cause the UI to flicker with the loading indicator while the next/prev items are fetching which we can both agree is quite a bad UX 😄.
In your specific case unless there is some strict UX requirements to have load more
button i would go with an infinite scroll which significantly reduced cognitive overhead on the user when consuming any sort of lists (feed/publications/etc).
Please have a look for inspiration inside our web-wagmi
example where we use infinite scroll approach and have already premade hook (https://github.com/lens-protocol/lens-sdk/blob/main/examples/web-wagmi/src/hooks/useInfiniteScroll.ts).
Let me know if that's helpful 🙏
from lens-sdk.
Related Issues (20)
- In the useLogin react hook, when the user cancel the signing message modal, an unhandled promise is being thrown instead of being handled by the SDK HOT 14
- Unable to retrieve the latest publication. @lens-protocol/react":1.3.1 HOT 3
- My React Native project encountered significant issues when upgrading to V2 HOT 4
- Add WalletAuthetificationToProfileAuthetification to sdk HOT 3
- Here is the diff that solved my problem: HOT 2
- The 'useOwnedHandles' hook failed to execute correctly in the production environment
- It seems that the data provided by useOwnedHandles is not sufficiently real-time. I am unable to retrieve the profile I purchased through this hook. HOT 2
- Support Node Engine 20 HOT 3
- When I switch to a new wallet, LensProvider doesn't replace with the new signer. Can anyone help me look at this issue HOT 3
- useSetProfileMetadata should update the profile cache returned by useSession HOT 2
- Support wagmi v2 HOT 5
- In the useOpenAction react hook, when the user doesn't have enough funds to collect, an unhandled promise is being thrown instead of being handled by the SDK HOT 7
- Add support for React suspense HOT 9
- Regression in latest version of the SDK 2.0.0-alpha.29 when creating a publication HOT 9
- Get a refreshed access token if expired HOT 29
- SSR support with the React SDK HOT 2
- export 'isObject' (imported as 'isObject') was not found in '@lens-protocol/shared-kernel' HOT 3
- Apollo cache issue when liking or bookmarking your own posts HOT 5
- @lens-protocol/react-web HOT 4
- usePublications failed to execute if one of publication on scope have an invalid encryption condition HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lens-sdk.