mirror of
https://github.com/LukeHagar/skeleton.git
synced 2025-12-06 04:21:15 +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={`
|
||||
function addMessage(): void {
|
||||
const newMessage = {
|
||||
id: messages.length,
|
||||
id: messageFeed.length,
|
||||
host: true,
|
||||
avatar: 48,
|
||||
name: 'Jane',
|
||||
@@ -574,7 +574,7 @@ function addMessage(): void {
|
||||
color: 'variant-soft-primary'
|
||||
};
|
||||
// Append the new message to the message feed
|
||||
messages = [...messages, newMessage];
|
||||
messageFeed = [...messageFeed, newMessage];
|
||||
// Clear the textarea message
|
||||
currentMessage = '';
|
||||
// Smoothly scroll to the bottom of the feed
|
||||
|
||||
Reference in New Issue
Block a user