simplify deleteChat logic

This commit is contained in:
Emil Elgaard 2023-03-26 16:47:47 -04:00
parent 17a86d0538
commit 4ee5d0e5f6
1 changed files with 1 additions and 3 deletions

View File

@ -50,8 +50,6 @@
export const deleteChat = (chatId: number) => { export const deleteChat = (chatId: number) => {
const chats = get(chatsStorage) const chats = get(chatsStorage)
const chatIndex = chats.findIndex((chat) => chat.id === chatId) chatsStorage.set(chats.filter((chat) => chat.id !== chatId))
chats.splice(chatIndex, 1)
chatsStorage.set(chats)
} }
</script> </script>