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

[CARE-6013] Feature - Refetch coverage when update event happens #569

Merged

Conversation

kudlajz
Copy link
Contributor

@kudlajz kudlajz commented Sep 17, 2024

No description provided.

@kudlajz kudlajz self-assigned this Sep 17, 2024
Comment on lines 63 to 71
function handleCoverageUpdated({ coverage }: { coverage: Pick<CoverageEntry, 'id'>}) {
if (element.coverage.id === coverage.id) {
loadCoverage();
}
}

useEffect(() => {
EventsEditor.addEventListener(editor, 'coverage-updated', handleCoverageUpdated);
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Shouldn't handleCoverageUpdated be a local function to the effect callback?
  2. Should it not remove the event listener in the effect unmount callback?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I forgot 🙂

@kudlajz kudlajz merged commit a58c9b5 into main Sep 17, 2024
9 checks passed
@kudlajz kudlajz deleted the feature/care-6013-coverage-card-data-not-updated-immediately branch September 17, 2024 15:10
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