mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-06 12:28:29 +00:00
Fix message composer presendCallback warnings
This commit is contained in:
committed by
Stefan Ceriu
parent
37ed7addf5
commit
a5fe629790
@@ -173,7 +173,7 @@ extension MapLibreMapView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func mapView(_ mapView: MGLMapView, regionDidChangeAnimated animated: Bool) {
|
func mapView(_ mapView: MGLMapView, regionDidChangeAnimated animated: Bool) {
|
||||||
// Fixes: "Publishing changes from within view updates is not allowed, this will cause undefined behavior."
|
// Avoid `Publishing changes from within view update` warnings
|
||||||
DispatchQueue.main.async { [mapLibreView] in
|
DispatchQueue.main.async { [mapLibreView] in
|
||||||
mapLibreView.mapCenterCoordinate = mapView.centerCoordinate
|
mapLibreView.mapCenterCoordinate = mapView.centerCoordinate
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ private struct CallView: UIViewRepresentable {
|
|||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
DispatchQueue.main.async { // Avoid `Publishing changes from within view update warnings`
|
DispatchQueue.main.async { // Avoid `Publishing changes from within view update` warnings
|
||||||
viewModelContext.javaScriptEvaluator = self.evaluateJavaScript
|
viewModelContext.javaScriptEvaluator = self.evaluateJavaScript
|
||||||
viewModelContext.requestPictureInPictureHandler = self.requestPictureInPicture
|
viewModelContext.requestPictureInPictureHandler = self.requestPictureInPicture
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-2
@@ -189,8 +189,11 @@ private class ElementTextView: UITextView, PillAttachmentViewProviderDelegate {
|
|||||||
|
|
||||||
super.init(frame: .zero, textContainer: nil)
|
super.init(frame: .zero, textContainer: nil)
|
||||||
|
|
||||||
presendCallback.wrappedValue = { [weak self] in
|
// Avoid `Publishing changes from within view update` warnings
|
||||||
self?.acceptCurrentSuggestion()
|
DispatchQueue.main.async {
|
||||||
|
presendCallback.wrappedValue = { [weak self] in
|
||||||
|
self?.acceptCurrentSuggestion()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ class TimelineTableViewController: UIViewController {
|
|||||||
/// Updates the typing members but also updates table view items
|
/// Updates the typing members but also updates table view items
|
||||||
func setTypingMembers(_ members: [String]) {
|
func setTypingMembers(_ members: [String]) {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
// Avoid `Publishing changes from within view update warnings`
|
// Avoid `Publishing changes from within view update` warnings
|
||||||
self.typingMembers.members = members
|
self.typingMembers.members = members
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user