[FE] For the invite member modal, only fetch custom roles when the modal is opened
Currently, the invite member modal is fetching custom roles when it's initialized, not when it's opened. init_invite_members_modal.js
is also called for every page in a group for Owner users of the group. As a result, the member roles GraphQL query is called for every page in a group, regardless if the modal is open or even accessible.
We should make the following changes:
-
Only initialize the modal on the page where it can be used, not for every page in the group.
-
Modify the GraphQL query call so that it's only called when the modal is opened.
Edited by Daniel Tian