Skip to content

Commit

Permalink
Fix modal sheet presentations when invoked from the timeline item men…
Browse files Browse the repository at this point in the history
…u sheet
  • Loading branch information
stefanceriu committed Jun 13, 2023
1 parent a85b313 commit dcb692c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit dcb692c

Please sign in to comment.