mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Merge pull request #6133 from vector-im/maximee/PSF-984_lls__fix_cell_reuse
6099: Fix bad interaction between static and live location cell
This commit is contained in:
commit
4866804b15
3 changed files with 13 additions and 4 deletions
|
@ -163,6 +163,7 @@ class RoomTimelineLocationView: UIView, NibLoadable, Themable, MGLMapViewDelegat
|
|||
bannerViewData: LiveLocationBannerViewData? = nil) {
|
||||
|
||||
if let location = location {
|
||||
mapView.isHidden = false
|
||||
mapView.styleURL = mapStyleURL
|
||||
|
||||
annotationView = LocationMarkerView.loadFromNib()
|
||||
|
@ -188,6 +189,8 @@ class RoomTimelineLocationView: UIView, NibLoadable, Themable, MGLMapViewDelegat
|
|||
// Configure live location banner
|
||||
guard let bannerViewData = bannerViewData else {
|
||||
liveLocationContainerView.isHidden = true
|
||||
placeholderBackground.isHidden = true
|
||||
placeholderIcon.isHidden = true
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -26,17 +26,17 @@ class LocationPlainCell: SizableBaseRoomCell, RoomCellReactionsDisplayable, Room
|
|||
super.render(cellData)
|
||||
|
||||
guard #available(iOS 14.0, *),
|
||||
let bubbleData = cellData as? RoomBubbleCellData
|
||||
let bubbleData = cellData as? RoomBubbleCellData,
|
||||
let event = bubbleData.events.last
|
||||
else {
|
||||
return
|
||||
}
|
||||
|
||||
locationView.update(theme: ThemeService.shared().theme)
|
||||
locationView.delegate = self
|
||||
self.event = event
|
||||
|
||||
if bubbleData.cellDataTag == .location,
|
||||
let event = bubbleData.events.last {
|
||||
self.event = event
|
||||
if bubbleData.cellDataTag == .location {
|
||||
renderStaticLocation(event)
|
||||
} else if bubbleData.cellDataTag == .liveLocation,
|
||||
let beaconInfoSummary = bubbleData.beaconInfoSummary {
|
||||
|
@ -127,6 +127,11 @@ class LocationPlainCell: SizableBaseRoomCell, RoomCellReactionsDisplayable, Room
|
|||
|
||||
contentView.vc_addSubViewMatchingParent(locationView)
|
||||
}
|
||||
|
||||
override func prepareForReuse() {
|
||||
super.prepareForReuse()
|
||||
self.event = nil
|
||||
}
|
||||
}
|
||||
|
||||
extension LocationPlainCell: RoomTimelineLocationViewDelegate {
|
||||
|
|
1
changelog.d/6099.bugfix
Normal file
1
changelog.d/6099.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Location sharing: fix bad interaction between static and live location cell
|
Loading…
Reference in a new issue