add push settings
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
||||
import { apiFetch } from '@/lib/api';
|
||||
import { DEFAULT_PUBLIC_API_URL, DEFAULT_PUBLIC_FRONTEND_URL, inferApiBaseFromProjectDomain } from '@/lib/project-domains';
|
||||
import { FirebasePublicConfig, parseFirebasePublicConfig } from '@/lib/firebase-config';
|
||||
|
||||
interface PublicSettingsContextValue {
|
||||
projectName: string;
|
||||
@@ -12,6 +13,7 @@ interface PublicSettingsContextValue {
|
||||
ldapEnabled: boolean;
|
||||
ldapUseLdaps: boolean;
|
||||
pinLockTimeoutMinutes: number;
|
||||
firebaseConfig: FirebasePublicConfig | null;
|
||||
isLoading: boolean;
|
||||
refreshPublicSettings: () => Promise<void>;
|
||||
}
|
||||
@@ -24,6 +26,7 @@ const PublicSettingsContext = createContext<PublicSettingsContextValue>({
|
||||
ldapEnabled: false,
|
||||
ldapUseLdaps: false,
|
||||
pinLockTimeoutMinutes: 15,
|
||||
firebaseConfig: null,
|
||||
isLoading: true,
|
||||
refreshPublicSettings: async () => undefined
|
||||
});
|
||||
@@ -68,6 +71,7 @@ export function PublicSettingsProvider({ children }: { children: React.ReactNode
|
||||
ldapEnabled: ['true', '1', 'yes'].includes((settings.LDAP_ENABLED ?? '').trim().toLowerCase()),
|
||||
ldapUseLdaps: ['true', '1', 'yes'].includes((settings.LDAP_USE_LDAPS ?? '').trim().toLowerCase()),
|
||||
pinLockTimeoutMinutes: Math.max(1, Number.parseInt(settings.PIN_LOCK_TIMEOUT_MINUTES ?? '15', 10) || 15),
|
||||
firebaseConfig: parseFirebasePublicConfig(settings),
|
||||
isLoading,
|
||||
refreshPublicSettings
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user