Merge pull request #19 from Michael-Tanzer/delete-chats

added option to delete individual chat
This commit is contained in:
Niek van der Maas 2023-03-06 19:25:19 +01:00 committed by GitHub
commit 97432612bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -150,6 +150,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> </script>
<nav class="level chat-header"> <nav class="level chat-header">
@ -179,6 +186,14 @@
> >
💡 💡
</a> </a>
<a
href={"#"}
class="greyscale ml-2 is-hidden editbutton"
title="Delete this chat"
on:click|preventDefault={deleteChat}
>
🗑️
</a>
</p> </p>
</div> </div>
</div> </div>