Skip to content

Commit

Permalink
Use ErrorTypographyWithDialog instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmcorvidae committed Oct 11, 2024
1 parent a7dbf50 commit 712bc81
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/components/instantlaunches/launch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import InstantLaunchButtonWrapper from "components/instantlaunches/InstantLaunch
import withErrorAnnouncer from "components/error/withErrorAnnouncer";
import LoadingAnimation from "components/vice/loading/LoadingAnimation";

import ErrorTypography from "components/error/ErrorTypography";
import DEErrorDialog from "components/error/DEErrorDialog";
import ErrorTypographyWithDialog from "components/error/ErrorTypographyWithDialog";

const InstantLaunchStandalone = (props) => {
const {
Expand All @@ -40,7 +39,6 @@ const InstantLaunchStandalone = (props) => {
const [computeLimitExceeded, setComputeLimitExceeded] = useState(
!!config?.subscriptions?.enforce
);
const [errorDialogOpen, setErrorDialogOpen] = useState(false);
const [resource, setResource] = useState(!!resource_path ? null : {});

const { t } = useTranslation(["instantlaunches", "common"]);
Expand Down Expand Up @@ -88,17 +86,10 @@ const InstantLaunchStandalone = (props) => {
} else if (error || resourceError) {
const err = error || resourceError;
return (
<>
<ErrorTypography
errorMessage={err.message}
onDetailsClick={() => setErrorDialogOpen(true)}
/>
<DEErrorDialog
open={errorDialogOpen}
errorObject={err}
handleClose={() => setErrorDialogOpen(false)}
/>
</>
<ErrorTypographyWithDialog
errorMessage={t("instantLaunchError")}
errorObject={err}
/>
);
} else {
return (
Expand Down

0 comments on commit 712bc81

Please sign in to comment.