Fix duplicated images when opening

This commit is contained in:
xmflsct 2022-08-14 22:48:15 +02:00
parent d0becef5bf
commit c125382965
2 changed files with 10 additions and 15 deletions

View File

@ -47,20 +47,6 @@ const TimelineAttachment = React.memo(
>([])
const navigation = useNavigation<StackNavigationProp<RootStackParamList>>()
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 (
<AttachmentImage
key={index}

View File

@ -5,7 +5,7 @@ const audio = () => {
log('log', 'audio', 'setting audio playback default options')
Audio.setAudioModeAsync({
playsInSilentModeIOS: true,
interruptionModeIOS: InterruptionModeIOS.DuckOthers,
interruptionModeIOS: InterruptionModeIOS.MixWithOthers,
interruptionModeAndroid: InterruptionModeAndroid.DuckOthers
})
}