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: before fetching subscriptions, ensure modal is visible #8389

Merged
merged 5 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const ManageService: React.FC<ManageServiceProps> = (props: ManageService
};

useEffect(() => {
if (isAuthenticated) {
if (isAuthenticated && !props.hidden) {
setAvailableSubscriptions([]);
setSubscriptionsErrorMessage(undefined);
getSubscriptions(currentUser.token)
Expand All @@ -153,7 +153,7 @@ export const ManageService: React.FC<ManageServiceProps> = (props: ManageService
setSubscriptionsErrorMessage(err.message);
});
}
}, [isAuthenticated]);
}, [isAuthenticated, props.hidden]);

useEffect(() => {
// reset the ui
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const CreateQnAModal: React.FC<CreateQnAModalProps> = (props) => {
}, []);

useEffect(() => {
if (isAuthenticated) {
if (isAuthenticated && showCreateQnAFrom) {
setAvailableSubscriptions([]);
setSubscriptionsErrorMessage(undefined);
getSubscriptions(currentUser.token)
Expand All @@ -173,7 +173,7 @@ export const CreateQnAModal: React.FC<CreateQnAModalProps> = (props) => {
setSubscriptionsErrorMessage(err.message);
});
}
}, [currentUser, isAuthenticated]);
}, [currentUser, isAuthenticated, showCreateQnAFrom]);

useEffect(() => {
// reset the ui
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const ReplaceQnAFromModal: React.FC<ReplaceQnAModalProps> = (props) => {
}, []);

useEffect(() => {
if (isAuthenticated) {
if (isAuthenticated && !hidden) {
setAvailableSubscriptions([]);
setSubscriptionsErrorMessage(undefined);
getSubscriptions(currentUser.token)
Expand All @@ -154,7 +154,7 @@ export const ReplaceQnAFromModal: React.FC<ReplaceQnAModalProps> = (props) => {
setSubscriptionsErrorMessage(err.message);
});
}
}, [currentUser, isAuthenticated]);
}, [currentUser, isAuthenticated, hidden]);

useEffect(() => {
// reset the ui
Expand Down