mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 14:54:33 +00:00
cleanup wrapper, suspense
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import "@/styles/globals.scss";
|
import "@/styles/globals.scss";
|
||||||
|
|
||||||
|
import { Alert, AlertType } from "@/components/alert";
|
||||||
import { LanguageProvider } from "@/components/language-provider";
|
import { LanguageProvider } from "@/components/language-provider";
|
||||||
import { LanguageSwitcher } from "@/components/language-switcher";
|
import { LanguageSwitcher } from "@/components/language-switcher";
|
||||||
import { Theme } from "@/components/theme";
|
import { Theme } from "@/components/theme";
|
||||||
@@ -23,7 +24,13 @@ export default async function RootLayout({
|
|||||||
<head />
|
<head />
|
||||||
<body>
|
<body>
|
||||||
<ThemeProvider>
|
<ThemeProvider>
|
||||||
<Suspense fallback={<div>Loading...</div>}>
|
<Suspense
|
||||||
|
fallback={
|
||||||
|
<div className="flex flex-row items-center justify-center py-4">
|
||||||
|
<Alert type={AlertType.INFO}>Loading...</Alert>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
<LanguageProvider>
|
<LanguageProvider>
|
||||||
<div
|
<div
|
||||||
className={`relative min-h-screen bg-background-light-600 dark:bg-background-dark-600 flex flex-col justify-center`}
|
className={`relative min-h-screen bg-background-light-600 dark:bg-background-dark-600 flex flex-col justify-center`}
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ export const idpService = createIdpServiceClient(transport);
|
|||||||
export const orgService = createOrganizationServiceClient(transport);
|
export const orgService = createOrganizationServiceClient(transport);
|
||||||
export const settingsService = createSettingsServiceClient(transport);
|
export const settingsService = createSettingsServiceClient(transport);
|
||||||
|
|
||||||
async function cacheWrapper(callback: Promise<unknown>) {
|
const useCache = process.env.DEBUG !== "true";
|
||||||
|
|
||||||
|
async function cacheWrapper<T>(callback: Promise<T>) {
|
||||||
"use cache";
|
"use cache";
|
||||||
cacheLife("hours");
|
cacheLife("hours");
|
||||||
|
|
||||||
@@ -62,8 +64,6 @@ async function cacheWrapper(callback: Promise<unknown>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getBrandingSettings(organization?: string) {
|
export async function getBrandingSettings(organization?: string) {
|
||||||
const useCache = process.env.DEBUG !== "true";
|
|
||||||
|
|
||||||
const callback = settingsService
|
const callback = settingsService
|
||||||
.getBrandingSettings({ ctx: makeReqCtx(organization) }, {})
|
.getBrandingSettings({ ctx: makeReqCtx(organization) }, {})
|
||||||
.then((resp) => (resp.settings ? resp.settings : undefined));
|
.then((resp) => (resp.settings ? resp.settings : undefined));
|
||||||
@@ -72,8 +72,6 @@ export async function getBrandingSettings(organization?: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getLoginSettings(orgId?: string) {
|
export async function getLoginSettings(orgId?: string) {
|
||||||
const useCache = process.env.DEBUG !== "true";
|
|
||||||
|
|
||||||
const callback = settingsService
|
const callback = settingsService
|
||||||
.getLoginSettings({ ctx: makeReqCtx(orgId) }, {})
|
.getLoginSettings({ ctx: makeReqCtx(orgId) }, {})
|
||||||
.then((resp) => (resp.settings ? resp.settings : undefined));
|
.then((resp) => (resp.settings ? resp.settings : undefined));
|
||||||
@@ -108,8 +106,6 @@ export async function registerTOTP(userId: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getGeneralSettings() {
|
export async function getGeneralSettings() {
|
||||||
const useCache = process.env.DEBUG !== "true";
|
|
||||||
|
|
||||||
const callback = settingsService
|
const callback = settingsService
|
||||||
.getGeneralSettings({}, {})
|
.getGeneralSettings({}, {})
|
||||||
.then((resp) => resp.supportedLanguages);
|
.then((resp) => resp.supportedLanguages);
|
||||||
@@ -118,8 +114,6 @@ export async function getGeneralSettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getLegalAndSupportSettings(organization?: string) {
|
export async function getLegalAndSupportSettings(organization?: string) {
|
||||||
const useCache = process.env.DEBUG !== "true";
|
|
||||||
|
|
||||||
const callback = settingsService
|
const callback = settingsService
|
||||||
.getLegalAndSupportSettings({ ctx: makeReqCtx(organization) }, {})
|
.getLegalAndSupportSettings({ ctx: makeReqCtx(organization) }, {})
|
||||||
.then((resp) => (resp.settings ? resp.settings : undefined));
|
.then((resp) => (resp.settings ? resp.settings : undefined));
|
||||||
@@ -128,8 +122,6 @@ export async function getLegalAndSupportSettings(organization?: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getPasswordComplexitySettings(organization?: string) {
|
export async function getPasswordComplexitySettings(organization?: string) {
|
||||||
const useCache = process.env.DEBUG !== "true";
|
|
||||||
|
|
||||||
const callback = settingsService
|
const callback = settingsService
|
||||||
.getPasswordComplexitySettings({ ctx: makeReqCtx(organization) })
|
.getPasswordComplexitySettings({ ctx: makeReqCtx(organization) })
|
||||||
.then((resp) => (resp.settings ? resp.settings : undefined));
|
.then((resp) => (resp.settings ? resp.settings : undefined));
|
||||||
|
|||||||
Reference in New Issue
Block a user