Skip to content
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

Fix: Redundant error notifications on block explorer #775

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

ChangoMan
Copy link
Contributor

Description

The toast error notifications that are on blockexplorer/page.tsx will currently render 3-4 times on the initial page visit. If you reload the page and there are errors, it will keep spamming the toast notifications.

This PR breaks up the useEffect that checks for targetNetwork and error. It also adds in 2 new useState hooks to control the triggering of error notifications.

BEFORE:

Screen.Recording.2024-03-13.at.12.07.52.AM.mov

AFTER:

Screen.Recording.2024-03-13.at.12.06.35.AM.mov

Additional Information

Copy link
Collaborator

@technophile-04 technophile-04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR breaks up the useEffect that checks for targetNetwork and error. It also adds in 2 new useState hooks to control the triggering of error notifications.

Nice ! makes sense, Tysm @ChangoMan for tackling it 🙌

@technophile-04 technophile-04 merged commit 49a6a4e into scaffold-eth:main Mar 13, 2024
1 check passed
@ChangoMan ChangoMan deleted the fix/blockchain-explorer branch March 20, 2024 01:32
@github-actions github-actions bot mentioned this pull request Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants