added option to delete individual chat

This commit is contained in:
Michael Tanzer 2023-03-06 17:58:27 +00:00
parent 840851a35b
commit cf15adad9d
1 changed files with 15 additions and 0 deletions

View File

@ -149,6 +149,13 @@
});
}
};
const deleteChat = () => {
if (confirm("Are you sure you want to delete this chat?")) {
chatsStorage.update((chats) => chats.filter((chat) => chat.id !== chatId));
chatId = null;
}
};
</script>
<nav class="level chat-header">
@ -178,6 +185,14 @@
>
💡
</a>
<a
href={"#"}
class="greyscale ml-2 is-hidden editbutton"
title="Delete this chat"
on:click|preventDefault={deleteChat}
>
🗑️
</a>
</p>
</div>
</div>