mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
Default the activity view to the bottom
This commit is contained in:
parent
24dad15636
commit
5bc6584bc2
1 changed files with 11 additions and 0 deletions
|
|
@ -56,6 +56,8 @@
|
|||
let previousAssetId: string | undefined = $state(assetId);
|
||||
let message = $state('');
|
||||
let isSendingMessage = $state(false);
|
||||
let scrollContainer: HTMLElement | undefined = $state();
|
||||
let hasScrolledToBottom = false;
|
||||
const isAlbumOwner = $derived(albumUsers[0].user.id === authManager.user.id);
|
||||
|
||||
const timeOptions: Intl.DateTimeFormatOptions = {
|
||||
|
|
@ -101,6 +103,14 @@
|
|||
$effect(() => {
|
||||
if (assetId && previousAssetId != assetId) {
|
||||
previousAssetId = assetId;
|
||||
hasScrolledToBottom = false;
|
||||
}
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (scrollContainer && activityManager.activities.length > 0 && !hasScrolledToBottom) {
|
||||
hasScrolledToBottom = true;
|
||||
scrollContainer.scrollTop = scrollContainer.scrollHeight;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -128,6 +138,7 @@
|
|||
</div>
|
||||
{#if innerHeight}
|
||||
<div
|
||||
bind:this={scrollContainer}
|
||||
class="relative w-full immich-scrollbar overflow-y-auto px-2"
|
||||
style="height: {divHeight}px;padding-bottom: {chatHeight}px"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue