Skip to content

Commit 0b26575

Browse files
committed
Add error log before presenting the Coupon creation success view with an empty coupon code
1 parent 25432d4 commit 0b26575

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

WooCommerce/Classes/ViewRelated/Coupons/Add and Edit Coupons/AddEditCoupon.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ struct AddEditCoupon: View {
306306
}
307307
.sheet(isPresented: $viewModel.showingCouponCreationSuccess) {
308308
let couponCode = viewModel.coupon?.code ?? ""
309+
if couponCode.isEmpty {
310+
let _ = DDLogError("⛔️ Error acquiring the coupon code after creation")
311+
}
309312
CouponCreationSuccess(couponCode: couponCode, shareMessage: viewModel.shareCouponMessage) {
310313
onDisappear()
311314
}

0 commit comments

Comments
 (0)