mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-25 17:51:01 +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 {
|
} else {
|
||||||
ScrollView(.horizontal, showsIndicators: showsScrollIndicators) {
|
ScrollView(.horizontal, showsIndicators: showsScrollIndicators) {
|
||||||
HStack {
|
HStack {
|
||||||
makeAttachmentView(for: 0)
|
ForEach(attachments) { attachment in
|
||||||
makeAttachmentView(for: 1)
|
makeAttachmentView(attachment)
|
||||||
makeAttachmentView(for: 2)
|
}
|
||||||
makeAttachmentView(for: 3)
|
|
||||||
}
|
}
|
||||||
.padding(.bottom, scrollBottomPadding)
|
.padding(.bottom, scrollBottomPadding)
|
||||||
}
|
}
|
||||||
|
@ -74,17 +73,18 @@ public struct StatusRowMediaPreviewView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private func makeAttachmentView(for index: Int) -> some View {
|
private func makeAttachmentView(_ attachement: MediaAttachment) -> some View {
|
||||||
if
|
if let data = DisplayData(from: attachement) {
|
||||||
attachments.count > index,
|
|
||||||
let data = DisplayData(from: attachments[index])
|
|
||||||
{
|
|
||||||
MediaPreview(
|
MediaPreview(
|
||||||
sensitive: sensitive,
|
sensitive: sensitive,
|
||||||
imageMaxHeight: imageMaxHeight,
|
imageMaxHeight: imageMaxHeight,
|
||||||
displayData: data
|
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