From e1d4c87ff07ff4a5c3ea4f94650098e6084a555e Mon Sep 17 00:00:00 2001 From: Jannik Streidl Date: Tue, 6 Feb 2024 11:22:34 +0100 Subject: [PATCH] Added the option to show the username in the chat in settings -> interface --- .../chat/Messages/UserMessage.svelte | 18 ++++++++---- .../components/chat/Settings/Interface.svelte | 28 ++++++++++++++++++- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/lib/components/chat/Messages/UserMessage.svelte b/src/lib/components/chat/Messages/UserMessage.svelte index a1993648..d9705c46 100644 --- a/src/lib/components/chat/Messages/UserMessage.svelte +++ b/src/lib/components/chat/Messages/UserMessage.svelte @@ -4,7 +4,7 @@ import { tick } from 'svelte'; import Name from './Name.svelte'; import ProfileImage from './ProfileImage.svelte'; - import { modelfiles } from '$lib/stores'; + import { modelfiles, settings, user as userStore } from '$lib/stores'; export let user; export let message; @@ -58,11 +58,19 @@ {#if $modelfiles.map((modelfile) => modelfile.tagName).includes(message.user)} {$modelfiles.find((modelfile) => modelfile.tagName === message.user)?.title} {:else} - You {message?.user ?? ''} + {#if $settings.showUsername} + {$userStore.name} + {:else} + You {message?.user ?? ''} + {/if} + {/if} + {:else} + {#if $settings.showUsername} + {$userStore.name} + {:else} + You + {/if} {/if} - {:else} - You - {/if} {#if message.timestamp}