added option to delete individual chat
This commit is contained in:
parent
840851a35b
commit
cf15adad9d
|
@ -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>
|
</script>
|
||||||
|
|
||||||
<nav class="level chat-header">
|
<nav class="level chat-header">
|
||||||
|
@ -178,6 +185,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>
|
||||||
|
|
Loading…
Reference in New Issue