mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-11 12:22:26 +00:00
fix redirect bug for some accounts when disable create org is enabled
This commit is contained in:
@@ -41,35 +41,31 @@ export default function OrganizationLanding({
|
||||
function getDescriptionText() {
|
||||
if (organizations.length === 0) {
|
||||
if (!disableCreateOrg) {
|
||||
return t('componentsErrorNoMemberCreate');
|
||||
return t("componentsErrorNoMemberCreate");
|
||||
} else {
|
||||
return t('componentsErrorNoMember');
|
||||
return t("componentsErrorNoMember");
|
||||
}
|
||||
}
|
||||
|
||||
return t('componentsMember', {count: organizations.length});
|
||||
return t("componentsMember", { count: organizations.length });
|
||||
}
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t('welcome')}</CardTitle>
|
||||
<CardTitle>{t("welcome")}</CardTitle>
|
||||
<CardDescription>{getDescriptionText()}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{organizations.length === 0 ? (
|
||||
disableCreateOrg ? (
|
||||
<p className="text-center text-muted-foreground">
|
||||
t('componentsErrorNoMember')
|
||||
</p>
|
||||
) : (
|
||||
!disableCreateOrg && (
|
||||
<Link href="/setup">
|
||||
<Button
|
||||
className="w-full h-auto py-3 text-lg"
|
||||
size="lg"
|
||||
>
|
||||
<Plus className="mr-2 h-5 w-5" />
|
||||
{t('componentsCreateOrg')}
|
||||
{t("componentsCreateOrg")}
|
||||
</Button>
|
||||
</Link>
|
||||
)
|
||||
|
||||
@@ -103,8 +103,10 @@ export default function SecurityKeyForm({
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
loadSecurityKeys();
|
||||
}, []);
|
||||
if (open) {
|
||||
loadSecurityKeys();
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
const registerSchema = z.object({
|
||||
name: z.string().min(1, { message: t("securityKeyNameRequired") }),
|
||||
|
||||
Reference in New Issue
Block a user