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):Prevent multiple provider room modal shown on service queue Change #962

Closed
wants to merge 1 commit into from

Conversation

makombe
Copy link
Contributor

@makombe makombe commented Jan 31, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Screenshots

Related Issue

Other

Copy link

@ojwanganto ojwanganto left a comment

Choose a reason for hiding this comment

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

Looks OK

Comment on lines +268 to +273
useEffect(() => {
// Clean up the modal state when navigating away or resetting provider room
return () => {
setProviderRoomModalShown(false);
};
}, [setProviderRoomModalShown]);
Copy link
Member

Choose a reason for hiding this comment

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

This feels like one of those cases where you might not need an effect. When should the modal be shown? There's other approaches suggested in the article that could be more appropriate in this instance.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not too familiar with the code. @makombe when should the modal be shown? This useEffect callback will only be run when navigating away from the page that has the active-visits-table. This will not prevent multiple modals from showing, right?

@sam-sny
Copy link

sam-sny commented Mar 22, 2024

There aren't any screenshots of the changes

@denniskigen
Copy link
Member

denniskigen commented Apr 4, 2024

@chibongho you alluded to this on today's squad call. Any thoughts on the approach?

@chibongho
Copy link
Contributor

I think we can close this with this commit. Please re-open if that's not the case.

@chibongho chibongho closed this Apr 30, 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
5 participants