|
@@ -61,12 +61,16 @@
|
|
|
};
|
|
|
|
|
|
const editChatTitle = async (id, _title) => {
|
|
|
- title = _title;
|
|
|
-
|
|
|
- await updateChatById(localStorage.token, id, {
|
|
|
- title: _title
|
|
|
- });
|
|
|
- await chats.set(await getChatList(localStorage.token));
|
|
|
+ if (_title === '') {
|
|
|
+ toast.error('Title cannot be an empty string.');
|
|
|
+ } else {
|
|
|
+ title = _title;
|
|
|
+
|
|
|
+ await updateChatById(localStorage.token, id, {
|
|
|
+ title: _title
|
|
|
+ });
|
|
|
+ await chats.set(await getChatList(localStorage.token));
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const deleteChat = async (id) => {
|
|
@@ -388,6 +392,7 @@
|
|
|
show = false;
|
|
|
}
|
|
|
}}
|
|
|
+ draggable="false"
|
|
|
>
|
|
|
<div class=" flex self-center flex-1 w-full">
|
|
|
<div
|