Skip to content

Conversation

@robot9706
Copy link
Contributor

@robot9706 robot9706 commented Aug 17, 2022

WS_TYPE_DYO_ERROR was handled multiple times by showing a toast, pages which use multiple useWebSocket hooks show multiple toasts.

Implemented a universal error handler in WebSocketClient which shows the toast, pages can still do their error handling logic using WS_TYPE_DYO_ERROR.

Added a WebSocket provider to create the socket only once.

@robot9706 robot9706 requested a review from a team August 17, 2022 14:57
Copy link
Collaborator

@polaroi8d polaroi8d left a comment

Choose a reason for hiding this comment

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

Is this solve that the platform shows error messages multiple times? LGTM (informal) but please wait for others with the merge.

@robot9706
Copy link
Contributor Author

Is this solve that the platform shows error messages multiple times? LGTM (informal) but please wait for others with the merge.

@polaroi8d Yep.

I'd also like @m8vago to check as well :)

@robot9706 robot9706 marked this pull request as draft August 18, 2022 11:13
@robot9706 robot9706 marked this pull request as ready for review August 19, 2022 12:44
Copy link
Collaborator

@polaroi8d polaroi8d left a comment

Choose a reason for hiding this comment

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

Still okey for me.

fix(web): ws-hook single toast error handler

fix: formatting

fix(crux-ui): changed useWebSocket hook translation

fix(crux-ui): moved ws to provider
@robot9706 robot9706 merged commit 0cb5bd8 into develop Aug 22, 2022
@robot9706 robot9706 deleted the fix/ws-error-hook branch August 22, 2022 13:34
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.

4 participants