Move timeline drag and drop handling to the recently introduced TimelineView.
This commit is contained in:
committed by
Stefan Ceriu
parent
f047e51ab8
commit
eeff596932
@@ -10,6 +10,7 @@ import WysiwygComposer
|
||||
|
||||
struct TimelineView: View {
|
||||
@ObservedObject var timelineContext: TimelineViewModel.Context
|
||||
@State private var dragOver = false
|
||||
|
||||
var body: some View {
|
||||
TimelineViewRepresentable()
|
||||
@@ -51,6 +52,15 @@ struct TimelineView: View {
|
||||
ReadReceiptsSummaryView(orderedReadReceipts: $0.orderedReceipts)
|
||||
.environmentObject(timelineContext)
|
||||
}
|
||||
.onDrop(of: ["public.item", "public.file-url"], isTargeted: $dragOver) { providers -> Bool in
|
||||
guard let provider = providers.first,
|
||||
provider.isSupportedForPasteOrDrop else {
|
||||
return false
|
||||
}
|
||||
|
||||
timelineContext.send(viewAction: .handlePasteOrDrop(provider: provider))
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user