Skip to content

Commit fd81274

Browse files
committed
OrderDetailsViewController: Fixing footer toggle
1 parent b2ac4a0 commit fd81274

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

WooCommerce/Classes/ViewRelated/Orders/OrderDetails/OrderDetailsViewController.swift

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ class OrderDetailsViewController: UIViewController {
2222
}
2323
}
2424

25-
private var billingIsHidden = true
25+
private var billingIsHidden = true {
26+
didSet {
27+
reloadSections()
28+
}
29+
}
2630
private var sections = [Section]() {
2731
didSet {
2832
guard isViewLoaded else {
@@ -256,7 +260,7 @@ extension OrderDetailsViewController {
256260
sendEmailIfPossible()
257261
}
258262

259-
func setShowHideFooter() {
263+
func toggleBillingFooter() {
260264
billingIsHidden = !billingIsHidden
261265
}
262266
}
@@ -320,10 +324,13 @@ extension OrderDetailsViewController: UITableViewDataSource {
320324
let image = billingIsHidden ? Gridicon.iconOfType(.chevronDown) : Gridicon.iconOfType(.chevronUp)
321325
cell.configure(text: footerText, image: image)
322326
cell.didSelectFooter = { [weak self] in
323-
self?.setShowHideFooter()
324-
self?.configureTableView()
327+
guard let `self` = self else {
328+
return
329+
}
330+
325331
let sections = IndexSet(integer: section)
326-
tableView.reloadSections(sections, with: .fade)
332+
self.toggleBillingFooter()
333+
self.tableView.reloadSections(sections, with: .fade)
327334
}
328335

329336
return cell

0 commit comments

Comments
 (0)