From cbbb6cca64a9c458522c10a91764446ce4505825 Mon Sep 17 00:00:00 2001 From: Sander Philipse Date: Thu, 10 Oct 2024 11:26:42 +0200 Subject: [PATCH] Replace \? with ! --- x-pack/packages/kbn-ai-assistant/src/hooks/use_conversation.ts | 2 +- .../kbn-ai-assistant/src/hooks/use_conversation_list.ts | 2 +- x-pack/packages/kbn-ai-assistant/src/hooks/use_current_user.ts | 2 +- .../packages/kbn-ai-assistant/src/hooks/use_knowledge_base.tsx | 2 +- .../src/hooks/use_simulated_function_calling.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/packages/kbn-ai-assistant/src/hooks/use_conversation.ts b/x-pack/packages/kbn-ai-assistant/src/hooks/use_conversation.ts index 484183b6928e5..744e071d5b1ba 100644 --- a/x-pack/packages/kbn-ai-assistant/src/hooks/use_conversation.ts +++ b/x-pack/packages/kbn-ai-assistant/src/hooks/use_conversation.ts @@ -100,7 +100,7 @@ export function useConversation({ }, }) .catch((err) => { - notifications?.toasts.addError(err, { + notifications!.toasts.addError(err, { title: i18n.translate('xpack.aiAssistant.errorUpdatingConversation', { defaultMessage: 'Could not update conversation', }), diff --git a/x-pack/packages/kbn-ai-assistant/src/hooks/use_conversation_list.ts b/x-pack/packages/kbn-ai-assistant/src/hooks/use_conversation_list.ts index d6ba75568dfd1..d0db7665a30b6 100644 --- a/x-pack/packages/kbn-ai-assistant/src/hooks/use_conversation_list.ts +++ b/x-pack/packages/kbn-ai-assistant/src/hooks/use_conversation_list.ts @@ -61,7 +61,7 @@ export function useConversationList(): UseConversationListResult { conversations.refresh(); } catch (err) { - notifications?.toasts.addError(err, { + notifications!.toasts.addError(err, { title: i18n.translate('xpack.aiAssistant.flyout.failedToDeleteConversation', { defaultMessage: 'Could not delete conversation', }), diff --git a/x-pack/packages/kbn-ai-assistant/src/hooks/use_current_user.ts b/x-pack/packages/kbn-ai-assistant/src/hooks/use_current_user.ts index 6721ee0360cbd..c169358653a49 100644 --- a/x-pack/packages/kbn-ai-assistant/src/hooks/use_current_user.ts +++ b/x-pack/packages/kbn-ai-assistant/src/hooks/use_current_user.ts @@ -19,7 +19,7 @@ export function useCurrentUser() { useEffect(() => { const getCurrentUser = async () => { try { - const authenticatedUser = await security?.authc.getCurrentUser(); + const authenticatedUser = await security!.authc.getCurrentUser(); setUser(authenticatedUser); } catch { setUser(undefined); diff --git a/x-pack/packages/kbn-ai-assistant/src/hooks/use_knowledge_base.tsx b/x-pack/packages/kbn-ai-assistant/src/hooks/use_knowledge_base.tsx index f5410ed671b95..0b949fcdbff0e 100644 --- a/x-pack/packages/kbn-ai-assistant/src/hooks/use_knowledge_base.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/hooks/use_knowledge_base.tsx @@ -70,7 +70,7 @@ export function useKnowledgeBase(): UseKnowledgeBaseResult { return install(); } setInstallError(error); - notifications?.toasts.addError(error, { + notifications!.toasts.addError(error, { title: i18n.translate('xpack.aiAssistant.errorSettingUpKnowledgeBase', { defaultMessage: 'Could not set up Knowledge Base', }), diff --git a/x-pack/packages/kbn-ai-assistant/src/hooks/use_simulated_function_calling.ts b/x-pack/packages/kbn-ai-assistant/src/hooks/use_simulated_function_calling.ts index 93287fc58aa79..4515f2126dbfd 100644 --- a/x-pack/packages/kbn-ai-assistant/src/hooks/use_simulated_function_calling.ts +++ b/x-pack/packages/kbn-ai-assistant/src/hooks/use_simulated_function_calling.ts @@ -13,7 +13,7 @@ export function useSimulatedFunctionCalling() { services: { uiSettings }, } = useKibana(); - const simulatedFunctionCallingEnabled = uiSettings?.get( + const simulatedFunctionCallingEnabled = uiSettings!.get( aiAssistantSimulatedFunctionCalling, false );