From 9ba714fa43429c5e9340a8df4b6440262819af70 Mon Sep 17 00:00:00 2001 From: anastasiia Date: Thu, 11 Jan 2024 09:26:13 -0500 Subject: [PATCH] init api on self-serve --- client/src/CloudApp.tsx | 5 ++++- client/src/Onboarding/SelfServe/index.tsx | 5 +++-- client/src/Project/EmptyProject.tsx | 2 +- client/src/components/Header/HeaderRightPart.tsx | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/client/src/CloudApp.tsx b/client/src/CloudApp.tsx index d280d52b53..a3a475dc34 100644 --- a/client/src/CloudApp.tsx +++ b/client/src/CloudApp.tsx @@ -4,6 +4,7 @@ import packageJson from '../package.json'; import App from './App'; import { LocaleContext } from './context/localeContext'; import i18n from './i18n'; +import './index.css'; import { getPlainFromStorage, LANGUAGE_KEY, @@ -12,9 +13,11 @@ import { import { LocaleType } from './types/general'; import { DeviceContextProvider } from './context/providers/DeviceContextProvider'; import { EnvContext } from './context/envContext'; -import { getConfig } from './services/api'; +import { getConfig, initApi } from './services/api'; +import { useComponentWillMount } from './hooks/useComponentWillMount'; const CloudApp = () => { + useComponentWillMount(() => initApi('/api', true)); const [envConfig, setEnvConfig] = useState({}); const [locale, setLocale] = useState( (getPlainFromStorage(LANGUAGE_KEY) as LocaleType | null) || 'en', diff --git a/client/src/Onboarding/SelfServe/index.tsx b/client/src/Onboarding/SelfServe/index.tsx index 1673212501..e27aea57cf 100644 --- a/client/src/Onboarding/SelfServe/index.tsx +++ b/client/src/Onboarding/SelfServe/index.tsx @@ -23,7 +23,7 @@ const SelfServe = () => { }, []); return ( -
+
@@ -39,7 +39,8 @@ const SelfServe = () => {
diff --git a/client/src/Project/EmptyProject.tsx b/client/src/Project/EmptyProject.tsx index 2e8eeeb6e6..1218ad5bf5 100644 --- a/client/src/Project/EmptyProject.tsx +++ b/client/src/Project/EmptyProject.tsx @@ -37,7 +37,7 @@ const EmptyProject = ({}: Props) => {

Press{' '} - + cmdKey {' '} diff --git a/client/src/components/Header/HeaderRightPart.tsx b/client/src/components/Header/HeaderRightPart.tsx index 8b4d396afc..a52d3c3872 100644 --- a/client/src/components/Header/HeaderRightPart.tsx +++ b/client/src/components/Header/HeaderRightPart.tsx @@ -26,7 +26,7 @@ const HeaderRightPart = ({}: Props) => { {envConfig.github_user?.avatar_url ? (