Spaces:
Build error
Build error
fix custom preprompt message display
Browse files
src/lib/components/chat/ChatMessages.svelte
CHANGED
@@ -11,6 +11,7 @@
|
|
11 |
import type { WebSearchUpdate } from "$lib/types/MessageUpdate";
|
12 |
import { browser } from "$app/environment";
|
13 |
import SystemPromptModal from "../SystemPromptModal.svelte";
|
|
|
14 |
|
15 |
export let messages: Message[];
|
16 |
export let loading: boolean;
|
@@ -44,8 +45,8 @@
|
|
44 |
>
|
45 |
<div class="mx-auto flex h-full max-w-3xl flex-col gap-6 px-5 pt-6 sm:gap-8 xl:max-w-4xl">
|
46 |
{#each messages as message, i}
|
47 |
-
{#if i === 0 && preprompt}
|
48 |
-
<SystemPromptModal {preprompt} />
|
49 |
{/if}
|
50 |
<ChatMessage
|
51 |
loading={loading && i === messages.length - 1}
|
|
|
11 |
import type { WebSearchUpdate } from "$lib/types/MessageUpdate";
|
12 |
import { browser } from "$app/environment";
|
13 |
import SystemPromptModal from "../SystemPromptModal.svelte";
|
14 |
+
import { page } from "$app/stores";
|
15 |
|
16 |
export let messages: Message[];
|
17 |
export let loading: boolean;
|
|
|
45 |
>
|
46 |
<div class="mx-auto flex h-full max-w-3xl flex-col gap-6 px-5 pt-6 sm:gap-8 xl:max-w-4xl">
|
47 |
{#each messages as message, i}
|
48 |
+
{#if i === 0 && preprompt !== $page.data.settings.customPrompts[currentModel.id]}
|
49 |
+
<SystemPromptModal preprompt={preprompt ?? ""} />
|
50 |
{/if}
|
51 |
<ChatMessage
|
52 |
loading={loading && i === messages.length - 1}
|