fix: Invariant violation – team required after deleting workspace
This commit is contained in:
@@ -22,7 +22,7 @@ type Props = {
|
|||||||
function TeamDelete({ onSubmit }: Props) {
|
function TeamDelete({ onSubmit }: Props) {
|
||||||
const [isWaitingCode, setWaitingCode] = React.useState(false);
|
const [isWaitingCode, setWaitingCode] = React.useState(false);
|
||||||
const { auth } = useStores();
|
const { auth } = useStores();
|
||||||
const team = useCurrentTeam();
|
const team = useCurrentTeam({ rejectOnEmpty: false });
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
@@ -61,7 +61,7 @@ function TeamDelete({ onSubmit }: Props) {
|
|||||||
required: env.EMAIL_ENABLED,
|
required: env.EMAIL_ENABLED,
|
||||||
});
|
});
|
||||||
const appName = env.APP_NAME;
|
const appName = env.APP_NAME;
|
||||||
const workspaceName = team.name;
|
const workspaceName = team?.name;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={formHandleSubmit(handleSubmit)}>
|
<form onSubmit={formHandleSubmit(handleSubmit)}>
|
||||||
|
|||||||
Reference in New Issue
Block a user