Skip to content

Commit cd903ca

Browse files
authored
Merge pull request #1858 from woocommerce/fix/orders-badge-not-refreshed-when-the-count-is-zero
Hotfix: fixed orders badge count when you switch between two stores (one with badge count = 0)
2 parents 637515b + 66bce1a commit cd903ca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Orders tab: The full total amount is now shown.
99
- Order Details & Product UI: if a Product name has HTML escape characters, they should be decoded in the app.
1010
- Order Details: if the Order has multiple Products, tapping on any Product should open the same Product now.
11+
- bugfix: the orders badge on tab bar now is correctly refreshed after switching to a store with badge count equal to zero.
1112

1213
3.5
1314
-----

WooCommerce/Classes/ViewRelated/MainTabBarController.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,7 @@ private extension MainTabBarController {
390390
private extension MainTabBarController {
391391
func startListeningToOrdersBadge() {
392392
viewModel.onBadgeReload = { [weak self] countReadableString in
393-
guard let self = self,
394-
let badgeText = countReadableString else {
393+
guard let self = self else {
395394
return
396395
}
397396

@@ -402,7 +401,7 @@ private extension MainTabBarController {
402401
return
403402
}
404403

405-
orderTab.badgeValue = badgeText
404+
orderTab.badgeValue = countReadableString
406405
orderTab.badgeColor = .primary
407406
}
408407

0 commit comments

Comments
 (0)