mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-22 08:20:59 +00:00
More fix for #1943
This commit is contained in:
parent
cfd6eed159
commit
75bb4f43dd
1 changed files with 10 additions and 10 deletions
|
@ -61,10 +61,9 @@ public struct StatusRowMediaPreviewView: View {
|
|||
} else {
|
||||
ScrollView(.horizontal, showsIndicators: showsScrollIndicators) {
|
||||
HStack {
|
||||
makeAttachmentView(for: 0)
|
||||
makeAttachmentView(for: 1)
|
||||
makeAttachmentView(for: 2)
|
||||
makeAttachmentView(for: 3)
|
||||
ForEach(attachments) { attachment in
|
||||
makeAttachmentView(attachment)
|
||||
}
|
||||
}
|
||||
.padding(.bottom, scrollBottomPadding)
|
||||
}
|
||||
|
@ -74,17 +73,18 @@ public struct StatusRowMediaPreviewView: View {
|
|||
}
|
||||
|
||||
@ViewBuilder
|
||||
private func makeAttachmentView(for index: Int) -> some View {
|
||||
if
|
||||
attachments.count > index,
|
||||
let data = DisplayData(from: attachments[index])
|
||||
{
|
||||
private func makeAttachmentView(_ attachement: MediaAttachment) -> some View {
|
||||
if let data = DisplayData(from: attachement) {
|
||||
MediaPreview(
|
||||
sensitive: sensitive,
|
||||
imageMaxHeight: imageMaxHeight,
|
||||
displayData: data
|
||||
)
|
||||
.onTapGesture { tabAction(for: index) }
|
||||
.onTapGesture {
|
||||
if let index = attachments.firstIndex(where: { $0.id == attachement.id }) {
|
||||
tabAction(for: index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue