From c125382965a68e12b600fc899b9cdedf457f6e32 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 14 Aug 2022 22:48:15 +0200 Subject: [PATCH] Fix duplicated images when opening --- src/components/Timeline/Shared/Attachment.tsx | 23 ++++++++----------- src/startup/audio.ts | 2 +- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/components/Timeline/Shared/Attachment.tsx b/src/components/Timeline/Shared/Attachment.tsx index 0d2f5c40..7c49a47c 100644 --- a/src/components/Timeline/Shared/Attachment.tsx +++ b/src/components/Timeline/Shared/Attachment.tsx @@ -47,20 +47,6 @@ const TimelineAttachment = React.memo( >([]) const navigation = useNavigation>() const navigateToImagesViewer = (id: string) => { - status.media_attachments.forEach(attachment => { - switch (attachment.type) { - case 'image': - imageUrls.current.push({ - id: attachment.id, - preview_url: attachment.preview_url, - url: attachment.url, - remote_url: attachment.remote_url, - blurhash: attachment.blurhash, - width: attachment.meta?.original?.width, - height: attachment.meta?.original?.height - }) - } - }) navigation.navigate('Screen-ImagesViewer', { imageUrls: imageUrls.current, id @@ -82,6 +68,15 @@ const TimelineAttachment = React.memo( {status.media_attachments.map((attachment, index) => { switch (attachment.type) { case 'image': + imageUrls.current.push({ + id: attachment.id, + preview_url: attachment.preview_url, + url: attachment.url, + remote_url: attachment.remote_url, + blurhash: attachment.blurhash, + width: attachment.meta?.original?.width, + height: attachment.meta?.original?.height + }) return ( { log('log', 'audio', 'setting audio playback default options') Audio.setAudioModeAsync({ playsInSilentModeIOS: true, - interruptionModeIOS: InterruptionModeIOS.DuckOthers, + interruptionModeIOS: InterruptionModeIOS.MixWithOthers, interruptionModeAndroid: InterruptionModeAndroid.DuckOthers }) }