diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-05-05 20:44:00 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-05-05 20:44:00 -0400 |
| commit | faacbb2757ecbe947d6a6534d28da5c815f5b3ff (patch) | |
| tree | 4b5f14962e4e7cf2c0c9c640ae907f84aa2174a1 /ui/lib/components | |
| parent | 713afd0b4963460cc37b3767c6b542c8c828d227 (diff) | |
Don't try to scroll the last message into view when there is no last message.
This was generating a DOM-related error viewing any empty channel:
TypeError: null is not an object (evaluating 'document.querySelector('.message-run:last-child .message:last-child').scrollIntoView')
Harmless in practice, but easily fixed and it keeps the console from filling up with natter.
Diffstat (limited to 'ui/lib/components')
| -rw-r--r-- | ui/lib/components/ActiveChannel.svelte | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/lib/components/ActiveChannel.svelte b/ui/lib/components/ActiveChannel.svelte index 30b8385..c38d10d 100644 --- a/ui/lib/components/ActiveChannel.svelte +++ b/ui/lib/components/ActiveChannel.svelte @@ -6,7 +6,7 @@ $effect(() => { // This is just to force it to track messageRuns. const _ = messageRuns; - document.querySelector('.message-run:last-child .message:last-child').scrollIntoView(); + document.querySelector('.message-run:last-child .message:last-child')?.scrollIntoView(); }); </script> |
