You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains 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
Dependency Management The where variable is added to the dependencies of the useMemo for variables and fullDataDownloader. Ensure that changes in where do not cause unnecessary re-renders or data fetches.
Data Handling The addition of accountId to the query variables in downloadFullData should be carefully reviewed to ensure that it does not lead to incorrect or unexpected data being fetched when accountId is an empty string.
Logic Change Removing the subspaceAccount check might allow unauthorized or unintended access to data. Ensure that this change aligns with the intended access controls and does not expose sensitive data.
Calculation Adjustment The change in page count calculation now accounts for any remainder items by adding an additional page. This logic should be verified to ensure it correctly handles all edge cases, especially when totalCount is zero or very low.
Add a guard clause to prevent function calls on undefined objects
Reinstate the guard clause to check for injector before calling setup(). This prevents the setup function from being called when injector is not available, which could lead to runtime errors.
Why: Reinstate the guard clause to check for injector before calling setup() is essential to prevent runtime errors. This is a critical fix that ensures the setup function is only called when injector is available.
10
Ensure conditions are checked to prevent errors
Restore the check for subspaceAccount in the conditional statement to ensure that the logic only executes when subspaceAccount is truthy. This prevents potential errors or unintended behavior when subspaceAccount is falsy.
Why: Restoring the check for subspaceAccount in the conditional statement is crucial to prevent potential errors or unintended behavior when subspaceAccount is falsy. This is a significant improvement for code safety and reliability.
9
Best practice
Use nullish coalescing to handle default values more accurately
Consider using nullish coalescing (??) instead of logical OR (||) when setting the accountId in the where object. This ensures that only null or undefined values are replaced with the default empty string, preserving other falsy values like 0 or false that might be valid.
Why: The suggestion to use nullish coalescing (??) instead of logical OR (||) is valid and improves the robustness of the code by ensuring that only null or undefined values are replaced with the default empty string, preserving other falsy values like 0 or false that might be valid.
8
Enhancement
Simplify the page count calculation using the Math.ceil function
Simplify the calculation of table pages by using the ceiling function from the Math library, which directly computes the number of pages needed without manual adjustments.
Why: The suggestion to use Math.ceil simplifies the calculation of table pages and makes the code more readable. While this is a good enhancement, it is not as critical as the other suggestions.
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.
User description
Sync Production with main
Including:
PR Type
Bug fix, Enhancement
Description
where
variable and updating thefullDataDownloader
to include it.accountId
to the query variables.OperatorsList
component.Changes walkthrough 📝
AccountExtrinsicList.tsx
Fix and enhance account extrinsics list query logic
explorer/src/components/Account/AccountExtrinsicList.tsx
where
variable to memoized query variables.fullDataDownloader
to includewhere
in the query.variables
memoization to use the newwhere
variable.AccountRewardList.tsx
Fix account rewards full download logic
explorer/src/components/Account/AccountRewardList.tsx
accountId
to thefullDataDownloader
query variables.table.ts
Fix page count calculation logic
explorer/src/utils/table.ts
remaining items.
OperatorsList.tsx
Allow visitors to see RPC operators list
explorer/src/components/Staking/OperatorsList.tsx
check.
WalletProvider.tsx
Simplify wallet provider setup logic
explorer/src/providers/WalletProvider.tsx
setup
.