Hide regenButton properly

update confirm code for slash commands
This commit is contained in:
timothycarambat 2024-05-14 15:06:30 -07:00
parent 275be6a0f3
commit 1e60cd57ff
2 changed files with 9 additions and 12 deletions

View File

@ -32,14 +32,13 @@ const Actions = ({
<div className="flex w-full justify-between items-center">
<div className="flex justify-start items-center gap-x-4">
<CopyMessage message={message} />
{isLastMessage &&
!message?.includes("Workspace chat memory was reset!") && (
<RegenerateMessage
regenerateMessage={regenerateMessage}
slug={slug}
chatId={chatId}
/>
)}
{isLastMessage && (
<RegenerateMessage
regenerateMessage={regenerateMessage}
slug={slug}
chatId={chatId}
/>
)}
{chatId && (
<>
<FeedbackButton
@ -127,6 +126,7 @@ function CopyMessage({ message }) {
}
function RegenerateMessage({ regenerateMessage, chatId }) {
if (!chatId) return null;
return (
<div className="mt-3 relative">
<button

View File

@ -31,10 +31,7 @@ export default function EditPresetModal({
};
const handleDelete = async () => {
const confirmDelete = window.confirm(
"Are you sure you want to delete this preset?"
);
if (!confirmDelete) return;
if (!window.confirm("Are you sure you want to delete this preset?")) return;
setDeleting(true);
await onDelete(preset.id);