File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { ExportPolicyButton } from "./ExportPolicyButton";
21
21
import IdpOrgSyncPageView from "./IdpOrgSyncPageView" ;
22
22
23
23
export const IdpOrgSyncPage : FC = ( ) => {
24
+ const [ claimField , setClaimField ] = useState ( "" ) ;
24
25
const queryClient = useQueryClient ( ) ;
25
26
// IdP sync does not have its own entitlement and is based on templace_rbac
26
27
const { template_rbac : isIdpSyncEnabled } = useFeatureVisibility ( ) ;
@@ -29,8 +30,17 @@ export const IdpOrgSyncPage: FC = () => {
29
30
data : orgSyncSettingsData ,
30
31
isLoading,
31
32
error,
32
- } = useQuery ( organizationIdpSyncSettings ( isIdpSyncEnabled ) ) ;
33
- const [ claimField , setClaimField ] = useState ( "" ) ;
33
+ } = useQuery (
34
+ organizationIdpSyncSettings ( isIdpSyncEnabled ) . queryKey ,
35
+ organizationIdpSyncSettings ( isIdpSyncEnabled ) . queryFn ,
36
+ {
37
+ onSuccess : ( data ) => {
38
+ if ( data ?. field ) {
39
+ setClaimField ( data . field ) ;
40
+ }
41
+ } ,
42
+ } ,
43
+ ) ;
34
44
35
45
const { data : claimFieldValues } = useQuery (
36
46
idpSyncClaimFieldValues ( claimField ) ,
You can’t perform that action at this time.
0 commit comments