Update reward info fetching and improve pool data handling #1169
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.
This pull request includes several changes to the
src/pages/Pools
andsrc/reducer/onchainTokens.ts
files to improve functionality and fix potential issues. The most important changes include updates to the reward information fetching logic, handling of null values, and enhancements to the token update process.Improvements to reward information fetching:
src/pages/Pools/hooks/hooks.ts
: Modified theuseQuery
call inuseGetRewardInfo
to disable refetching on window focus, which can improve performance.Handling of null values:
src/pages/Pools/hooks/hooks.ts
: UpdatedgetClaimableInfoByPool
to handle cases wherepool.rewardPerSec
might be null, preventing potential errors.Enhancements to token update process:
src/reducer/onchainTokens.ts
: Added a call toaddToOraichainTokens
inoptimisticUpdateToken
to ensure tokens are properly added to the state.Other changes:
src/pages/Pools/index.tsx
: AddeduseEffect
import to manage side effects and updatedListPools
andListPoolsMobile
components to display empty arrays when the address is not provided, improving conditional rendering logic. [1] [2]src/reducer/onchainTokens.ts
: ImportedupdateAllOraichainTokens
to ensure all tokens are updated correctly.