mirror of
https://github.com/open-webui/open-webui
synced 2024-11-06 16:59:42 +00:00
refac: ui optimisation
This commit is contained in:
parent
29c39d44e1
commit
e421be5759
@ -140,8 +140,6 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const nameUpdateHandler = async () => {
|
const nameUpdateHandler = async () => {
|
||||||
name = name.trim();
|
|
||||||
|
|
||||||
if (name === '') {
|
if (name === '') {
|
||||||
toast.error("Folder name can't be empty");
|
toast.error("Folder name can't be empty");
|
||||||
return;
|
return;
|
||||||
@ -152,8 +150,15 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const currentName = folders[folderId].name;
|
||||||
|
|
||||||
|
name = name.trim();
|
||||||
|
folders[folderId].name = name;
|
||||||
|
|
||||||
const res = await updateFolderNameById(localStorage.token, folderId, name).catch((error) => {
|
const res = await updateFolderNameById(localStorage.token, folderId, name).catch((error) => {
|
||||||
toast.error(error);
|
toast.error(error);
|
||||||
|
|
||||||
|
folders[folderId].name = currentName;
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user