Spaces:
Runtime error
Runtime error
Commit
•
b56bba1
1
Parent(s):
3451d26
✨ Replace title by conversation title (#118)
Browse files
src/routes/+layout.svelte
CHANGED
@@ -3,7 +3,6 @@
|
|
3 |
import { goto, invalidate } from "$app/navigation";
|
4 |
import { page } from "$app/stores";
|
5 |
import "../styles/main.css";
|
6 |
-
import type { LayoutData } from "./$types";
|
7 |
import { base } from "$app/paths";
|
8 |
import { PUBLIC_ORIGIN } from "$env/static/public";
|
9 |
|
@@ -15,7 +14,7 @@
|
|
15 |
import NavMenu from "$lib/components/NavMenu.svelte";
|
16 |
import Toast from "$lib/components/Toast.svelte";
|
17 |
|
18 |
-
export let data
|
19 |
|
20 |
let isNavOpen = false;
|
21 |
let errorToastTimeout: NodeJS.Timeout;
|
|
|
3 |
import { goto, invalidate } from "$app/navigation";
|
4 |
import { page } from "$app/stores";
|
5 |
import "../styles/main.css";
|
|
|
6 |
import { base } from "$app/paths";
|
7 |
import { PUBLIC_ORIGIN } from "$env/static/public";
|
8 |
|
|
|
14 |
import NavMenu from "$lib/components/NavMenu.svelte";
|
15 |
import Toast from "$lib/components/Toast.svelte";
|
16 |
|
17 |
+
export let data;
|
18 |
|
19 |
let isNavOpen = false;
|
20 |
let errorToastTimeout: NodeJS.Timeout;
|
src/routes/conversation/[id]/+page.svelte
CHANGED
@@ -2,7 +2,6 @@
|
|
2 |
import ChatWindow from "$lib/components/chat/ChatWindow.svelte";
|
3 |
import { pendingMessage } from "$lib/stores/pendingMessage";
|
4 |
import { onMount } from "svelte";
|
5 |
-
import type { PageData } from "./$types";
|
6 |
import { page } from "$app/stores";
|
7 |
import { textGenerationStream } from "@huggingface/inference";
|
8 |
import { invalidate } from "$app/navigation";
|
@@ -12,7 +11,7 @@
|
|
12 |
import { UrlDependency } from "$lib/types/UrlDependency";
|
13 |
import { error } from "$lib/stores/errors";
|
14 |
|
15 |
-
export let data
|
16 |
|
17 |
let messages = data.messages;
|
18 |
let lastLoadedMessages = data.messages;
|
@@ -141,8 +140,14 @@
|
|
141 |
writeMessage(val);
|
142 |
}
|
143 |
});
|
|
|
|
|
144 |
</script>
|
145 |
|
|
|
|
|
|
|
|
|
146 |
<ChatWindow
|
147 |
{loading}
|
148 |
{pending}
|
|
|
2 |
import ChatWindow from "$lib/components/chat/ChatWindow.svelte";
|
3 |
import { pendingMessage } from "$lib/stores/pendingMessage";
|
4 |
import { onMount } from "svelte";
|
|
|
5 |
import { page } from "$app/stores";
|
6 |
import { textGenerationStream } from "@huggingface/inference";
|
7 |
import { invalidate } from "$app/navigation";
|
|
|
11 |
import { UrlDependency } from "$lib/types/UrlDependency";
|
12 |
import { error } from "$lib/stores/errors";
|
13 |
|
14 |
+
export let data;
|
15 |
|
16 |
let messages = data.messages;
|
17 |
let lastLoadedMessages = data.messages;
|
|
|
140 |
writeMessage(val);
|
141 |
}
|
142 |
});
|
143 |
+
|
144 |
+
$: title = data.conversations.find((conv) => conv.id === $page.params.id)?.title ?? data.title;
|
145 |
</script>
|
146 |
|
147 |
+
<svelte:head>
|
148 |
+
<title>{title}</title>
|
149 |
+
</svelte:head>
|
150 |
+
|
151 |
<ChatWindow
|
152 |
{loading}
|
153 |
{pending}
|
src/routes/r/[id]/+page.svelte
CHANGED
@@ -60,6 +60,10 @@
|
|
60 |
}
|
61 |
</script>
|
62 |
|
|
|
|
|
|
|
|
|
63 |
<ChatWindow
|
64 |
on:message={(ev) => createConversation(ev.detail)}
|
65 |
on:share={shareConversation}
|
|
|
60 |
}
|
61 |
</script>
|
62 |
|
63 |
+
<svelte:head>
|
64 |
+
<title>{data.title}</title>
|
65 |
+
</svelte:head>
|
66 |
+
|
67 |
<ChatWindow
|
68 |
on:message={(ev) => createConversation(ev.detail)}
|
69 |
on:share={shareConversation}
|