Skip to content

Commit 6135d24

Browse files
authored
Merge pull request KelvinTegelaar#3631 from KelvinTegelaar/dev
null safety sam wizard
2 parents fe6c5d1 + a279d8b commit 6135d24

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/components/CippWizard/CIPPDeploymentStep.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { CippWizardStepButtons } from "./CippWizardStepButtons";
1616
import { ApiGetCall } from "../../api/ApiCall";
1717
import CippButtonCard from "../CippCards/CippButtonCard";
1818
import { CippCopyToClipBoard } from "../CippComponents/CippCopyToClipboard";
19-
import { CheckCircle } from "@mui/icons-material";
19+
import { CheckCircle, Sync } from "@mui/icons-material";
2020
import CippPermissionCheck from "../CippSettings/CippPermissionCheck";
2121
import { useQueryClient } from "@tanstack/react-query";
2222
import { CippApiResults } from "../CippComponents/CippApiResults";
@@ -43,7 +43,7 @@ export const CippDeploymentStep = (props) => {
4343
const appId = ApiGetCall({
4444
url: `/api/ExecListAppId`,
4545
queryKey: `ExecListAppId`,
46-
waiting: values.selectedOption !== "UpdateTokens" ? false : true,
46+
waiting: true,
4747
});
4848
useEffect(() => {
4949
if (
@@ -260,19 +260,29 @@ export const CippDeploymentStep = (props) => {
260260
disabled={
261261
appId.isLoading ||
262262
!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
263-
appId.data.applicationId
263+
appId?.data?.applicationId
264264
)
265265
}
266-
onClick={() => openPopup(appId.data.refreshUrl)}
266+
onClick={() => openPopup(appId?.data?.refreshUrl)}
267267
color="primary"
268268
>
269269
Refresh Graph Token
270270
</Button>
271+
<Button
272+
onClick={() => appId.refetch()}
273+
variant="contained"
274+
color="primary"
275+
startIcon={<Sync />}
276+
disabled={appId.isFetching}
277+
>
278+
Check Application ID
279+
</Button>
271280
{!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
272-
appId.data.applicationId
281+
appId?.data?.applicationId
273282
) && (
274283
<Alert severity="warning">
275-
The Application ID is not valid. Please return to the first page of the SAM wizard and use the Manual .
284+
The Application ID is not valid. Please return to the first page of the SAM
285+
wizard and use the Manual .
276286
</Alert>
277287
)}
278288
</>

0 commit comments

Comments
 (0)