-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DNM] Hero Graph remove old block for new block #101
[DNM] Hero Graph remove old block for new block #101
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't modify data in a render. Move this to the redux action. Add an env for MAX_BLOCKS
and if latestBlocks > MAX_BLOCKS then splice off the last.
Thanks @Krakaw. I've moved it to the API call. |
@@ -13,6 +13,7 @@ const config = { | |||
process.env.REACT_APP_EXPLORER_API_DOMAIN + '/ws' | |||
), | |||
tokenName: process.env.REACT_APP_TOKEN_NAME || 'tXTR', | |||
initialBlockCount: +(process.env.REACT_APP_INITIAL_BLOCK_COUNT || 100) | |||
initialBlockCount: +(process.env.REACT_APP_INITIAL_BLOCK_COUNT || 100), | |||
maxBlocks: +(process.env.REACT_APP_MAX_BLOCKS || 100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the env to the .env.sample file
if(blocks.blocks.length > config.maxBlocks) { | ||
blocks.blocks.splice(-1,1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to the redux action. Also how do we know that we only need to reduce by 1? We could've fetched 200 blocks.
@msbodetti any chance you could please take care of @Krakaw's feedback? Then I'll get this approved and merged - it's a definite improvement! |
Awesome thanks! There's no rush 🙏 |
Description
When the explorer is opened, new blocks will keep rolling in and the graph becomes unreadable.
Screencast
https://share.getcloudapp.com/E0uzYYjj
Closes: #70