From 872573d6c539d2eed189ebd0563fe00287ac1f67 Mon Sep 17 00:00:00 2001 From: Bilal Dieumegard Date: Fri, 6 Dec 2024 01:13:23 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20l'update=20en=20temps=20reel=20du?= =?UTF-8?q?=20d=C3=A9lai=20des=20messages=20et=20scroll=20up=20auto=20quan?= =?UTF-8?q?d=20un=20chat=20est=20cr=C3=A9=C3=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/components/Message.svelte | 26 +++++++++++++++++++++++-- src/lib/components/ui/ChatItem.svelte | 20 ++++++++++++++++++- src/lib/components/ui/CreateChat.svelte | 5 +++++ src/routes/api/channels/+server.ts | 1 + src/routes/chats/+page.svelte | 8 ++++++-- 5 files changed, 55 insertions(+), 5 deletions(-) diff --git a/src/lib/components/Message.svelte b/src/lib/components/Message.svelte index 14c3f15..d5fcc43 100644 --- a/src/lib/components/Message.svelte +++ b/src/lib/components/Message.svelte @@ -1,11 +1,32 @@ @@ -13,7 +34,7 @@
Profile Picture @@ -24,8 +45,9 @@
+ - {formatDistanceToNow(createdAt)} + {timeElapsed} diff --git a/src/lib/components/ui/ChatItem.svelte b/src/lib/components/ui/ChatItem.svelte index 52c005b..fcefea6 100644 --- a/src/lib/components/ui/ChatItem.svelte +++ b/src/lib/components/ui/ChatItem.svelte @@ -1,10 +1,28 @@ @@ -12,7 +30,7 @@

{title}

{lastMessage}

-

{formatDistanceToNow(createdAt)}

+

{timeElapsed}