diff --git a/src/plugins/workspace/public/components/workspace_creator/workspace_creator.tsx b/src/plugins/workspace/public/components/workspace_creator/workspace_creator.tsx index a0bdd80c9ca6..a7a2b247914a 100644 --- a/src/plugins/workspace/public/components/workspace_creator/workspace_creator.tsx +++ b/src/plugins/workspace/public/components/workspace_creator/workspace_creator.tsx @@ -110,6 +110,13 @@ export const WorkspaceCreator = (props: WorkspaceCreatorProps) => { [notifications?.toasts, http, application, workspaceClient] ); + const isFormReadyToRender = + application && + savedObjects && + // Default values only worked for component mount, should wait for isOnlyAllowEssential and availableUseCases loaded + isOnlyAllowEssential !== undefined && + availableUseCases !== undefined; + return ( { color="subdued" hasShadow={false} > - {application && - savedObjects && - // Default values only worked for component mount, should wait for isOnlyAllowEssential and availableUseCases loaded - isOnlyAllowEssential !== undefined && - availableUseCases !== undefined && ( - - )} + {isFormReadyToRender && ( + + )} diff --git a/src/plugins/workspace/public/components/workspace_form/use_form_available_use_cases.ts b/src/plugins/workspace/public/components/workspace_form/use_form_available_use_cases.ts index bbbf92c82079..8aea12326173 100644 --- a/src/plugins/workspace/public/components/workspace_form/use_form_available_use_cases.ts +++ b/src/plugins/workspace/public/components/workspace_form/use_form_available_use_cases.ts @@ -41,7 +41,7 @@ export const useFormAvailableUseCases = ({ const result = await getIsOnlyAllowEssentialUseCase(savedObjects.client); updateEssential(result); } catch (e) { - // Set to false is failed to fetch is only allow essential use case + // Set to false if failed to fetch the "only allow essential use case" setting updateEssential(false); } })();