Skip to content

Commit

Permalink
fix: invalid row counts (#184)
Browse files Browse the repository at this point in the history
Co-authored-by: Vittorio Cellucci <vel@qlik.com>
  • Loading branch information
vcellu and vcellu committed Jan 31, 2023
1 parent 1e3d00c commit 73a5c52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ios/ContainerView.swift
Expand Up @@ -123,12 +123,9 @@ class ContainerView: UIView {
NotificationCenter.default.post(name: Notification.Name.onClearSelectionBand, object: nil)
let json = try JSONSerialization.data(withJSONObject: rows)
let decodedRows = try JSONDecoder().decode(RowsObject.self, from: json)
let dataRowsEmpty = decodedRows.rows?.isEmpty ?? true
if(dataRowsEmpty) {
return
}


if(dataRows != nil && dataRows?[0].cells.count != decodedRows.rows?[0].cells.count) {
if(dataRows != nil && decodedRows.rows?.count != 0 && dataRows?.count != 0 && dataRows?[0].cells.count != decodedRows.rows?[0].cells.count) {
return
}
if dataRows == nil || decodedRows.reset == true {
Expand Down
5 changes: 5 additions & 0 deletions ios/DataCollectionView.swift
Expand Up @@ -88,6 +88,11 @@ class DataCollectionView: UIView, UICollectionViewDataSource, UICollectionViewDe
}

func scrollToTop() {
if let dataRows = dataRows {
if dataRows.isEmpty {
return
}
}
if let childCollectionView = childCollectionView {
childCollectionView.scrollToItem(at: IndexPath(item: 0, section: 0), at: .top, animated: true)
}
Expand Down

0 comments on commit 73a5c52

Please sign in to comment.