Skip to content

Commit

Permalink
Hide regenButton properly
Browse files Browse the repository at this point in the history
update confirm code for slash commands
  • Loading branch information
timothycarambat committed May 14, 2024
1 parent 275be6a commit 1e60cd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -127,6 +126,7 @@ function CopyMessage({ message }) {
}

function RegenerateMessage({ regenerateMessage, chatId }) {
if (!chatId) return null;
return (
<div className="mt-3 relative">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1e60cd5

Please sign in to comment.