From e5c812f1d298d9b5a92ae50dac61773d269dfce4 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 1 Mar 2024 22:35:08 -0800 Subject: [PATCH] refac --- src/routes/(app)/+page.svelte | 12 +++--------- src/routes/(app)/c/[id]/+page.svelte | 14 +++++--------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index c35b6cd8..e345e2be 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -69,7 +69,6 @@ let tags = []; let title = ''; - let pageTitle = WEBUI_NAME; let prompt = ''; let files = []; let messages = []; @@ -78,13 +77,6 @@ currentId: null }; - $: if (title) { - const trimmedTitle = title.length > 30 ? `${title.slice(0, 30)}...` : title; - pageTitle = `${trimmedTitle} | ${$WEBUI_NAME}`; - } else { - pageTitle = $WEBUI_NAME; - } - $: if (history.currentId !== null) { let _messages = []; @@ -819,7 +811,9 @@ - {pageTitle} + {title + ? `${title.length > 30 ? `${title.slice(0, 30)}...` : title} | ${$WEBUI_NAME}` + : `${$WEBUI_NAME}`} diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index bd449652..8448339f 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -72,7 +72,6 @@ let tags = []; let title = ''; - let pageTitle = WEBUI_NAME; let prompt = ''; let files = []; @@ -82,13 +81,6 @@ currentId: null }; - $: if (title) { - const trimmedTitle = title.length > 30 ? `${title.slice(0, 30)}...` : title; - pageTitle = `${trimmedTitle} | ${$WEBUI_NAME}`; - } else { - pageTitle = $WEBUI_NAME; - } - $: if (history.currentId !== null) { let _messages = []; @@ -834,7 +826,11 @@ - {pageTitle} + + {title + ? `${title.length > 30 ? `${title.slice(0, 30)}...` : title} | ${$WEBUI_NAME}` + : `${$WEBUI_NAME}`} + {#if loaded}