Skip to content

Commit

Permalink
Move additional checks for adding default rows into the extension
Browse files Browse the repository at this point in the history
  • Loading branch information
staskus committed Jun 20, 2024
1 parent 25bf46d commit 7684a35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ extension UITableViewCell {
inStackView rowsStackView: UIStackView,
forType statType: StatType,
configuration: StatsTotalRowConfiguration) {
if rowsStackView.arrangedSubviews.isEmpty {
addDefaultTotalRows(toStackView: rowsStackView)
}

guard !dataRows.isEmpty else {
configureForNoData(inStackView: rowsStackView, forType: statType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class CountriesCell: StatsBaseCell, NibLoadable {
bottomSeparatorLine.isHidden = forDetails

if !forDetails {
if rowsStackView.arrangedSubviews.isEmpty {
addDefaultTotalRows(toStackView: rowsStackView)
}
configureTotalRows(
dataRows,
inStackView: rowsStackView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ class TopTotalsCell: StatsBaseCell, NibLoadable {
self.forDetails = forDetails

if !forDetails {
if rowsStackView.arrangedSubviews.isEmpty {
addDefaultTotalRows(toStackView: rowsStackView)
}
configureTotalRows(
dataRows,
inStackView: rowsStackView,
Expand Down

0 comments on commit 7684a35

Please sign in to comment.