From 480f9c2c2be9cdcc9564d14ee32c8cc1f8e83fc2 Mon Sep 17 00:00:00 2001 From: tjtanjin Date: Fri, 10 May 2024 19:50:48 +0800 Subject: [PATCH] refactor: Rename sensitive info section to sensitive input --- src/components/ChatBotContainer.tsx | 6 +++--- src/components/ChatBotInput/ChatBotInput.tsx | 2 +- src/services/BotOptionsService.tsx | 2 +- src/types/Options.tsx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/ChatBotContainer.tsx b/src/components/ChatBotContainer.tsx index dcfa6a4d..72b21d95 100644 --- a/src/components/ChatBotContainer.tsx +++ b/src/components/ChatBotContainer.tsx @@ -625,10 +625,10 @@ const ChatBotContainer = ({ flow }: { flow: Flow }) => { } if (block.isSensitive) { - if (botOptions?.sensitiveInfo?.hideInBubble) { + if (botOptions?.sensitiveInput?.hideInBubble) { return; - } else if (botOptions?.sensitiveInfo?.maskInBubble) { - await injectMessage("*".repeat(botOptions.sensitiveInfo?.asterisksCount as number || 10), "user"); + } else if (botOptions?.sensitiveInput?.maskInBubble) { + await injectMessage("*".repeat(botOptions.sensitiveInput?.asterisksCount as number || 10), "user"); return; } } diff --git a/src/components/ChatBotInput/ChatBotInput.tsx b/src/components/ChatBotInput/ChatBotInput.tsx index 90b6688c..826516fb 100644 --- a/src/components/ChatBotInput/ChatBotInput.tsx +++ b/src/components/ChatBotInput/ChatBotInput.tsx @@ -181,7 +181,7 @@ const ChatBotInput = ({ className="rcb-chat-input" > {/* textarea intentionally does not use the disabled property to prevent keyboard from closing on mobile */} - {textAreaSensitiveMode && botOptions.sensitiveInfo?.maskInTextArea ? + {textAreaSensitiveMode && botOptions.sensitiveInput?.maskInTextArea ? } type="password" diff --git a/src/services/BotOptionsService.tsx b/src/services/BotOptionsService.tsx index 8cc77bdc..ec58b715 100644 --- a/src/services/BotOptionsService.tsx +++ b/src/services/BotOptionsService.tsx @@ -96,7 +96,7 @@ const defaultOptions = { messagePromptText: "New Messages ↓", messagePromptOffset: 30, }, - sensitiveInfo: { + sensitiveInput: { maskInTextArea: true, maskInBubble: true, asterisksCount: 10, diff --git a/src/types/Options.tsx b/src/types/Options.tsx index a2fcbcb1..440f1c28 100644 --- a/src/types/Options.tsx +++ b/src/types/Options.tsx @@ -75,7 +75,7 @@ export type Options = { messagePromptText?: string; messagePromptOffset?: number; }, - sensitiveInfo?: { + sensitiveInput?: { maskInTextArea?: boolean; maskInBubble?: boolean; asterisksCount?: number;