Skip to content

Commit f5e8d4d

Browse files
committed
refac
1 parent 51621ba commit f5e8d4d

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

backend/open_webui/models/users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class UserIdNameResponse(BaseModel):
188188
name: str
189189

190190

191-
class UserIdNameStatusResponse(BaseModel):
191+
class UserIdNameStatusResponse(UserStatus):
192192
id: str
193193
name: str
194194
is_active: Optional[bool] = None

src/lib/components/layout/Sidebar/ChannelItem.svelte

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import Hashtag from '$lib/components/icons/Hashtag.svelte';
1616
import Users from '$lib/components/icons/Users.svelte';
1717
import XMark from '$lib/components/icons/XMark.svelte';
18+
import Emoji from '$lib/components/common/Emoji.svelte';
1819
1920
export let onUpdate: Function = () => {};
2021
@@ -131,14 +132,38 @@
131132
{/if}
132133
</div>
133134

134-
<div class=" text-left self-center overflow-hidden w-full line-clamp-1 flex-1 pr-1">
135+
<div
136+
class=" text-left self-center overflow-hidden w-full line-clamp-1 flex-1 pr-1 flex items-center gap-2.5"
137+
>
135138
{#if channel?.name}
136-
{channel.name}
139+
<span>
140+
{channel.name}
141+
</span>
137142
{:else}
138-
{channel?.users
139-
?.filter((u) => u.id !== $user?.id)
140-
.map((u) => u.name)
141-
.join(', ')}
143+
<span class="shrink-0">
144+
{channel?.users
145+
?.filter((u) => u.id !== $user?.id)
146+
.map((u) => u.name)
147+
.join(', ')}
148+
</span>
149+
150+
{#if channel?.users?.length === 2}
151+
{@const dmUser = channel.users.find((u) => u.id !== $user?.id)}
152+
153+
{#if dmUser?.status_emoji || dmUser?.status_message}
154+
<span class="flex gap-1.5">
155+
{#if dmUser?.status_emoji}
156+
<div class=" self-center shrink-0">
157+
<Emoji className="size-3.5" shortCode={dmUser?.status_emoji} />
158+
</div>
159+
{/if}
160+
161+
<div class="line-clamp-1 italic">
162+
{dmUser?.status_message}
163+
</div>
164+
</span>
165+
{/if}
166+
{/if}
142167
{/if}
143168
</div>
144169
</div>

0 commit comments

Comments
 (0)