Fix modal sheet presentations when invoked from the timeline item menu sheet

This commit is contained in:
Stefan Ceriu 2023-06-13 16:59:37 +03:00 committed by Stefan Ceriu
parent a85b313669
commit dcb692ce9f

View File

@ -215,7 +215,10 @@ public struct TimelineItemMenu: View {
private func send(_ action: TimelineItemMenuAction) {
presentationMode.wrappedValue.dismiss()
context.send(viewAction: .timelineItemMenuAction(itemID: item.id, action: action))
// Otherwise we might get errors that a sheet is already presented
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
context.send(viewAction: .timelineItemMenuAction(itemID: item.id, action: action))
}
}
private struct MenuLabel: View {