Skip to content

Commit

Permalink
Merge pull request #279 from it-at-m/fix-title-change-bot
Browse files Browse the repository at this point in the history
🔧 fixed title change and reload site after editing
  • Loading branch information
pilitz authored Jan 28, 2025
2 parents c4c30d2 + 2a57500 commit c512c7e
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const BotsettingsDrawer = ({ bot, onBotChange, onDeleteBot, actions, befo
};
const onTitleChange = (_ev: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: TextareaOnChangeData) => {
if (newValue?.value) setTitle(newValue.value);
else setTitle("Assistent " + bot.id);
else setTitle("");
};
const onDescriptionChange = (_ev: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: TextareaOnChangeData) => {
if (newValue?.value) setDescription(newValue.value);
Expand All @@ -88,16 +88,19 @@ export const BotsettingsDrawer = ({ bot, onBotChange, onDeleteBot, actions, befo
const toggleReadOnly = () => {
setEditable(!isEditable);
if (isEditable) {
const newBot = {
const updatedTitle = title.trim() !== "" ? title : `Assistent ${bot.id}`;
setTitle(updatedTitle);
const updatedBot = {
...bot,
temperature: temperature,
max_output_tokens: max_output_tokens,
temperature,
max_output_tokens,
system_message: systemPrompt,
title: title,
description: description,
publish: publish
title: updatedTitle,
description,
publish
};
onBotChange(newBot);
onBotChange(updatedBot);
window.location.reload();
}
};

Expand Down

0 comments on commit c512c7e

Please sign in to comment.