diff --git a/package.json b/package.json index c641309..193f1b6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "voipms-desktop", "productName": "bubble", - "version": "0.8.0", + "version": "0.8.1", "description": "Signal-style desktop SMS client for voip.ms", "author": "trav ", "private": true, diff --git a/resources/android/VoipMessages.apk b/resources/android/VoipMessages.apk index 252d6be..ed75864 100644 Binary files a/resources/android/VoipMessages.apk and b/resources/android/VoipMessages.apk differ diff --git a/src/renderer/src/components/ConversationInfo.tsx b/src/renderer/src/components/ConversationInfo.tsx index cb737af..37fdbf5 100644 --- a/src/renderer/src/components/ConversationInfo.tsx +++ b/src/renderer/src/components/ConversationInfo.tsx @@ -1,4 +1,4 @@ -import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react' +import { useEffect, useMemo, useState } from 'react' import { formatNumber, groupMembers, isGroup } from '@shared/phone' import type { ContactInfo, Message } from '@shared/types' import type { ConvKey } from '../App' @@ -18,13 +18,12 @@ interface Props { onClose: () => void } -// Every picture and video in the chat as thumbnails, oldest first like the -// chat itself, scrolled to the newest. Each opens full size; ← → step through. +// Every picture and video in the chat as thumbnails, newest first. Each opens +// full size, where ← is older and → newer, as in the chat. function MediaGrid({ conv }: { conv: ConvKey }) { const [messages, setMessages] = useState() const [open, setOpen] = useState() const [broken, setBroken] = useState>(new Set()) - const grid = useRef(null) useEffect(() => { let cancelled = false void window.api.getMessages(conv.did, conv.contact).then((m) => !cancelled && setMessages(m)) @@ -33,9 +32,6 @@ function MediaGrid({ conv }: { conv: ConvKey }) { } }, [conv.did, conv.contact]) const items = useMemo(() => conversationMedia(messages ?? []), [messages]) - useLayoutEffect(() => { - if (grid.current) grid.current.scrollTop = grid.current.scrollHeight - }, [items]) if (!messages) return null const key = (it: MediaItem): string => `${it.id}:${it.index}` @@ -45,8 +41,8 @@ function MediaGrid({ conv }: { conv: ConvKey }) { Media{items.length ? · {items.length} : null} {items.length ? ( -
- {items.map((it, i) => ( +
+ {items.map((it, i) => ({ it, i })).reverse().map(({ it, i }) => (