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