From ed44b21a78e3f27bf1c26d877f2a82ba952f4eb1 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 23 Dec 2024 01:19:30 -0700 Subject: [PATCH] enh: edited indicator --- backend/open_webui/models/messages.py | 6 ++++-- src/lib/components/channel/Messages/Message.svelte | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/models/messages.py b/backend/open_webui/models/messages.py index 7edce8616..2a4322d0d 100644 --- a/backend/open_webui/models/messages.py +++ b/backend/open_webui/models/messages.py @@ -64,6 +64,8 @@ class MessageTable: ) -> Optional[MessageModel]: with get_db() as db: id = str(uuid.uuid4()) + + ts = int(time.time_ns()) message = MessageModel( **{ "id": id, @@ -72,8 +74,8 @@ class MessageTable: "content": form_data.content, "data": form_data.data, "meta": form_data.meta, - "created_at": int(time.time_ns()), - "updated_at": int(time.time_ns()), + "created_at": ts, + "updated_at": ts, } ) diff --git a/src/lib/components/channel/Messages/Message.svelte b/src/lib/components/channel/Messages/Message.svelte index 525f6ab61..e7793c472 100644 --- a/src/lib/components/channel/Messages/Message.svelte +++ b/src/lib/components/channel/Messages/Message.svelte @@ -96,7 +96,7 @@ dir={$settings.chatDirection} >
{#if showUserProfile} {:else}
- + {#if message.created_at !== message.updated_at}(edited){/if}
{/if}