mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
refac
This commit is contained in:
parent
9d87688ecc
commit
11efb982c1
1 changed files with 10 additions and 30 deletions
|
|
@ -213,11 +213,16 @@
|
|||
};
|
||||
|
||||
const onClickOutside = (event) => {
|
||||
if (confirmEdit && !event.target.closest(`#chat-title-input-${id}`)) {
|
||||
if (!itemElement.contains(event.target)) {
|
||||
if (confirmEdit) {
|
||||
if (chatTitle !== title) {
|
||||
editChatTitle(id, chatTitle);
|
||||
}
|
||||
|
||||
confirmEdit = false;
|
||||
ignoreBlur = false;
|
||||
chatTitle = '';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onMount(() => {
|
||||
|
|
@ -365,16 +370,6 @@
|
|||
disabled={generating}
|
||||
on:keydown={chatTitleInputKeydownHandler}
|
||||
on:blur={async (e) => {
|
||||
// check if target is generate button
|
||||
if (ignoreBlur) {
|
||||
ignoreBlur = false;
|
||||
|
||||
if (e.relatedTarget?.id === 'generate-title-button') {
|
||||
generateTitleHandler();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (doubleClicked) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
|
@ -388,13 +383,6 @@
|
|||
doubleClicked = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatTitle !== title) {
|
||||
editChatTitle(id, chatTitle);
|
||||
}
|
||||
|
||||
confirmEdit = false;
|
||||
chatTitle = '';
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -473,16 +461,8 @@
|
|||
class=" self-center dark:hover:text-white transition disabled:cursor-not-allowed"
|
||||
id="generate-title-button"
|
||||
disabled={generating}
|
||||
on:mouseenter={() => {
|
||||
ignoreBlur = true;
|
||||
}}
|
||||
on:click={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
e.stopPropagation();
|
||||
|
||||
on:click={() => {
|
||||
generateTitleHandler();
|
||||
ignoreBlur = false;
|
||||
}}
|
||||
>
|
||||
<Sparkles strokeWidth="2" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue