Skip to content

Commit

Permalink
refactor: Rename sensitive info section to sensitive input
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed May 10, 2024
1 parent 2597e3e commit 480f9c2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/ChatBotContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChatBotInput/ChatBotInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
<input
ref={inputRef as RefObject<HTMLInputElement>}
type="password"
Expand Down
2 changes: 1 addition & 1 deletion src/services/BotOptionsService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const defaultOptions = {
messagePromptText: "New Messages ↓",
messagePromptOffset: 30,
},
sensitiveInfo: {
sensitiveInput: {
maskInTextArea: true,
maskInBubble: true,
asterisksCount: 10,
Expand Down
2 changes: 1 addition & 1 deletion src/types/Options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export type Options = {
messagePromptText?: string;
messagePromptOffset?: number;
},
sensitiveInfo?: {
sensitiveInput?: {
maskInTextArea?: boolean;
maskInBubble?: boolean;
asterisksCount?: number;
Expand Down

0 comments on commit 480f9c2

Please sign in to comment.