mirror of
https://github.com/LukeHagar/skeleton.git
synced 2025-12-06 12:47:44 +00:00
Update +page.svelte (#1568)
Changed `messages` to `messageFeed` since `messages` variable doesn't exist in earlier codes.
This commit is contained in:
@@ -565,7 +565,7 @@ function scrollChatBottom(behavior?: ScrollBehavior): void {
|
|||||||
code={`
|
code={`
|
||||||
function addMessage(): void {
|
function addMessage(): void {
|
||||||
const newMessage = {
|
const newMessage = {
|
||||||
id: messages.length,
|
id: messageFeed.length,
|
||||||
host: true,
|
host: true,
|
||||||
avatar: 48,
|
avatar: 48,
|
||||||
name: 'Jane',
|
name: 'Jane',
|
||||||
@@ -574,7 +574,7 @@ function addMessage(): void {
|
|||||||
color: 'variant-soft-primary'
|
color: 'variant-soft-primary'
|
||||||
};
|
};
|
||||||
// Append the new message to the message feed
|
// Append the new message to the message feed
|
||||||
messages = [...messages, newMessage];
|
messageFeed = [...messageFeed, newMessage];
|
||||||
// Clear the textarea message
|
// Clear the textarea message
|
||||||
currentMessage = '';
|
currentMessage = '';
|
||||||
// Smoothly scroll to the bottom of the feed
|
// Smoothly scroll to the bottom of the feed
|
||||||
|
|||||||
Reference in New Issue
Block a user