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: fixed ignored error, added toast for error messages #65

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

irubido
Copy link
Collaborator

@irubido irubido commented Feb 11, 2025

Closes #62

@irubido irubido requested a review from Lykhoyda February 11, 2025 13:26
@@ -172,6 +169,7 @@ export const WebZjsProvider = ({ children }: { children: React.ReactNode }) => {

return (
<WebZjsContext.Provider value={{ state, dispatch }}>
<Toaster />
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be outside the context as a Toaster component is a placeholder for toast renders. So probably we can locate it in component

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Toaster component should be in parent rather then every component that needs to display error.
Alternatively it has its wrapper for displaying errors across the app. For current scope it only displays WebZjsContext-s errors.

Comment on lines -149 to -151
const timeout = setTimeout(() => {
dispatch({ type: 'set-error', payload: null });
}, 10000);
Copy link
Contributor

Choose a reason for hiding this comment

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

this logic clears the errors as webz-wallet might have some during the sync state, but it will keep running anyway. So this logic is still required

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It cleared WebZjsContext-s state.error which wasn't even used in the app, it was just set and cleared for no reason.

Now its used by react-hot-toast which removes the toast after set duration.

@irubido irubido requested a review from Lykhoyda February 18, 2025 15:49
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.

web-wallet improvment - Handle user deleting IDB case
2 participants