0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

Merge pull request #5931 from logto-io/gao-support-multi-region-paid-plans

refactor(console): support multi-region for paid plans
This commit is contained in:
Gao Sun 2024-05-28 22:15:32 +08:00 committed by GitHub
commit 3f910af825
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 7 deletions

View file

@ -23,16 +23,16 @@ export default function Main() {
return <AppLoading />;
}
// If current tenant ID is not set, but the defaultTenantId is available.
if (defaultTenantId) {
return <Redirect toTenantId={defaultTenantId} />;
}
// A new user has just signed up, redirect them to the onboarding flow.
if (isOnboarding) {
return <Navigate to={GlobalRoute.Onboarding} />;
}
// If current tenant ID is not set, but the defaultTenantId is available.
if (defaultTenantId) {
return <Redirect toTenantId={defaultTenantId} />;
}
// If user has pending invitations (onboarding will be skipped), show the invitation list and allow them to quick join.
if (isCloud && data?.length) {
return <InvitationList invitations={data} />;

View file

@ -41,8 +41,8 @@ function SelectTenantPlanModal({ tenantData, onClose }: Props) {
const { id: planId } = plan;
try {
if (planId === ReservedPlanId.Free) {
const { name, tag } = tenantData;
const newTenant = await cloudApi.post('/api/tenants', { body: { name, tag } });
const { name, tag, regionName } = tenantData;
const newTenant = await cloudApi.post('/api/tenants', { body: { name, tag, regionName } });
reportToGoogle(GtagConversionId.CreateProductionTenant, { transactionId: newTenant.id });
onClose(newTenant);

View file

@ -59,6 +59,7 @@ const useSubscribe = () => {
tenantId,
tenantName: tenantData?.name,
tenantTag: tenantData?.tag,
tenantRegionName: tenantData?.regionName,
},
});