From d5d0e72590fbd4df06ef644ce26d3faba9fe55df Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 27 Nov 2025 07:39:00 -0500 Subject: [PATCH] refac --- backend/open_webui/routers/channels.py | 4 ++-- src/routes/+layout.svelte | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/routers/channels.py b/backend/open_webui/routers/channels.py index 2167e87d47..1bf905155e 100644 --- a/backend/open_webui/routers/channels.py +++ b/backend/open_webui/routers/channels.py @@ -129,9 +129,9 @@ async def get_all_channels(user=Depends(get_verified_user)): @router.post("/create", response_model=Optional[ChannelModel]) async def create_new_channel(form_data: ChannelForm, user=Depends(get_admin_user)): try: - if form_data.type == "dm" and len(form_data.user_ids) == 1: + if form_data.type == "dm": existing_channel = Channels.get_dm_channel_by_user_ids( - [user.id, form_data.user_ids[0]] + [user.id, *form_data.user_ids] ) if existing_channel: Channels.update_member_active_status(existing_channel.id, user.id, True) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index c6e1e3e946..a42c975a62 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -511,9 +511,11 @@ } if (type === 'message') { + const title = `${data?.user?.name}${event?.channel?.type !== 'dm' ? ` (#${event?.channel?.name})` : ''}`; + if ($isLastActiveTab) { if ($settings?.notificationEnabled ?? false) { - new Notification(`${data?.user?.name} (#${event?.channel?.name}) • Open WebUI`, { + new Notification(`${title} • Open WebUI`, { body: data?.content, icon: `${WEBUI_API_BASE_URL}/users/${data?.user?.id}/profile/image` }); @@ -526,7 +528,7 @@ goto(`/channels/${event.channel_id}`); }, content: data?.content, - title: `#${event?.channel?.name}` + title: `${title}` }, duration: 15000, unstyled: true