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

Add callback and dependency matrix useclient #855

Merged
merged 27 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ad4ab1f
Add Additional Error Messages for KMS Key lookup on imported dataset …
noah-paige Sep 15, 2023
dbbef3c
Get Latest in main to v2m1m0 (#771)
noah-paige Sep 19, 2023
d096160
Handle Environment Import of IAM service roles (#749)
noah-paige Sep 26, 2023
a53434f
Build Compliant Names for Opensearch Resources (#750)
noah-paige Oct 5, 2023
16c7026
Merge branch 'main' into v2m1m0
dlpzx Oct 10, 2023
c61ba15
Update Lambda runtime (#782)
nikpodsh Oct 10, 2023
f84250e
Feat: limit pivot role S3 permissions (#780)
dlpzx Oct 12, 2023
7d9122d
Fix: ensure valid environments for share request and other objects cr…
dlpzx Oct 12, 2023
1801cf1
Adding configurable session timeout to IDP (#786)
manjulaK Oct 13, 2023
599fc1a
Fix: shell true semgrep (#760)
dlpzx Oct 16, 2023
b356bf2
Fix: allow to submit a share when you are both and approver and a req…
fourtyplustwo Oct 16, 2023
793a078
feat: redirect upon creating a share request (#799)
fourtyplustwo Oct 16, 2023
f448613
Fix: condition when there are no public subnets (#794)
lorchda Oct 18, 2023
66b9a08
feat: removing unused variable (#815)
fourtyplustwo Oct 18, 2023
c833c26
feat: Handle Pre-filtering of tables (#811)
anushka-singh Oct 18, 2023
6cc564e
Fix Check other share exists before clean up (#769)
noah-paige Oct 18, 2023
8b7b82e
Email Notification on Share Workflow - Issue - 734 (#818)
TejasRGitHub Oct 20, 2023
48c32e5
feat: adding frontend and backend feature flags (#817)
fourtyplustwo Oct 25, 2023
6d727e9
Feat: Refactor notifications from core to modules (#822)
dlpzx Oct 26, 2023
8ad760b
Merge branch 'main' into v2m1m0
dlpzx Oct 27, 2023
3f100b4
Feat: pivot role limit kms (#830)
dlpzx Oct 27, 2023
fb7b61b
Make hosted_zone_id optional, code update (#812)
lorchda Oct 27, 2023
b51da2c
Clean-up for v2.1 (#843)
dlpzx Oct 30, 2023
b54860d
fix: adding missing pivot role permission to get key policy (#845)
fourtyplustwo Oct 31, 2023
7390afe
Add callback and dependency matrix useclient
noah-paige Nov 3, 2023
cc8df25
Add dependency setReAuth callback
noah-paige Nov 6, 2023
a7efab0
Get latest from main
noah-paige Nov 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions frontend/src/services/hooks/useClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
HttpLink,
InMemoryCache
} from 'apollo-boost';
import { useEffect, useState } from 'react';
import { useEffect, useState, useCallback } from 'react';
import { useToken, useAuth } from 'authentication';
import { SET_ERROR, useDispatch } from 'globalErrors';

Expand All @@ -31,15 +31,18 @@ export const useClient = () => {
const token = useToken();
const auth = useAuth();

const setReAuth = async (requestInfo) => {
auth.dispatch({
type: 'REAUTH',
payload: {
reAuthStatus: true,
requestInfo: requestInfo
}
});
};
const setReAuth = useCallback(
async (requestInfo) => {
auth.dispatch({
type: 'REAUTH',
payload: {
reAuthStatus: true,
requestInfo: requestInfo
}
});
},
[auth]
);

useEffect(() => {
const initClient = async () => {
Expand Down Expand Up @@ -93,6 +96,6 @@ export const useClient = () => {
if (token) {
initClient().catch((e) => console.error(e));
}
}, [token, dispatch]);
}, [token, dispatch, setReAuth]);
return client;
};