From 10de50416bfae94f3865e36567c2d2ad8b89da03 Mon Sep 17 00:00:00 2001 From: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Sun, 21 May 2023 14:01:46 -0400 Subject: [PATCH] feat(HoverButtons.jsx): enable message regeneration for bingAI endpoint (#349) feat(HoverButtons.jsx): add active class to copy button only if message is not created by user --- client/src/components/Messages/HoverButtons.jsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/client/src/components/Messages/HoverButtons.jsx b/client/src/components/Messages/HoverButtons.jsx index 3349761097..3a37ac6e52 100644 --- a/client/src/components/Messages/HoverButtons.jsx +++ b/client/src/components/Messages/HoverButtons.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import { cn } from '~/utils/'; import Clipboard from '../svg/Clipboard'; import CheckMark from '../svg/CheckMark'; import EditIcon from '../svg/EditIcon'; @@ -13,14 +14,13 @@ export default function HoverButtons({ message, regenerate }) { - const { endpoint, jailbreak = false } = conversation; + const { endpoint } = conversation; const [isCopied, setIsCopied] = React.useState(false); const branchingSupported = - // azureOpenAI, openAI, chatGPTBrowser support branching, so edit enabled - !!['azureOpenAI', 'openAI', 'chatGPTBrowser', 'google'].find((e) => e === endpoint) || - // Sydney in bingAI supports branching, so edit enabled - (endpoint === 'bingAI' && jailbreak); + // azureOpenAI, openAI, chatGPTBrowser support branching, so edit enabled // 5/21/23: Bing is allowing editing and Message regenerating + !!['azureOpenAI', 'openAI', 'chatGPTBrowser', 'google', 'bingAI'].find((e) => e === endpoint); + // Sydney in bingAI supports branching, so edit enabled const editEnabled = !message?.error && @@ -30,7 +30,7 @@ export default function HoverButtons({ branchingSupported; // for now, once branching is supported, regerate will be enabled - const regenerateEnabled = + let regenerateEnabled = // !message?.error && !message?.isCreatedByUser && !message?.searchResult && @@ -64,7 +64,10 @@ export default function HoverButtons({ ) : null}