Make more robust
This commit is contained in:
parent
8865b5095d
commit
1cea77fbb8
|
@ -26,7 +26,7 @@
|
||||||
<div class="column is-one-fifth">
|
<div class="column is-one-fifth">
|
||||||
<Sidebar bind:apiKey bind:sortedChats />
|
<Sidebar bind:apiKey bind:sortedChats />
|
||||||
</div>
|
</div>
|
||||||
<div class="column is-four-fifths">
|
<div class="column is-four-fifths" id="content">
|
||||||
{#key $location}
|
{#key $location}
|
||||||
<Router {routes} />
|
<Router {routes} />
|
||||||
{/key}
|
{/key}
|
||||||
|
|
|
@ -162,8 +162,7 @@
|
||||||
// Scroll to the bottom of the chat on update
|
// Scroll to the bottom of the chat on update
|
||||||
afterUpdate(() => {
|
afterUpdate(() => {
|
||||||
// Scroll to the bottom of the page after any updates to the messages array
|
// Scroll to the bottom of the page after any updates to the messages array
|
||||||
const chatWindow = document.getElementsByClassName('column is-four-fifths')[0]
|
document.querySelector('#content')?.scrollIntoView({ behavior: 'smooth', block: 'end' })
|
||||||
chatWindow.scrollIntoView({ behavior: 'smooth', block: 'end' })
|
|
||||||
input.focus()
|
input.focus()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue