From c8205b847590b5c232417af6fc34e92e07e94624 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Sat, 25 May 2024 10:02:09 +0530 Subject: [PATCH] tsc The only place I can currently find where this code would run is on the delete account dialog, where props.color is being passed. --- web/packages/shared/components/EnteButton.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/packages/shared/components/EnteButton.tsx b/web/packages/shared/components/EnteButton.tsx index ea0a93660..365d648a3 100644 --- a/web/packages/shared/components/EnteButton.tsx +++ b/web/packages/shared/components/EnteButton.tsx @@ -1,3 +1,4 @@ +import { ensure } from "@/utils/ensure"; import Done from "@mui/icons-material/Done"; import { Button, CircularProgress, type ButtonProps } from "@mui/material"; @@ -21,8 +22,10 @@ export default function EnteButton({ ...sx, ...((loading || success) && { "&.Mui-disabled": (theme) => ({ - backgroundColor: theme.palette[props.color].main, - color: theme.palette[props.color].contrastText, + // TODO: Refactor to not need this ensure. + backgroundColor: + theme.palette[ensure(props.color)].main, + color: theme.palette[ensure(props.color)].contrastText, }), }), }}