Skip to content

Commit 7f49582

Browse files
committed
Dismiss notice after 5 seconds delay
1 parent a13cdfc commit 7f49582

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

WooCommerce/Classes/View Modifiers/View+NoticesModifier.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ struct NoticeModifier: ViewModifier {
2121
// NoticeView wrapper
2222
NoticeAlert(notice: notice, width: geometry.size.width)
2323
.fixedSize(horizontal: false, vertical: true)
24+
.onAppear {
25+
// TODO: Move this to a proper state management class
26+
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
27+
$notice.wrappedValue = nil
28+
}
29+
}
2430
.onTapGesture {
2531
$notice.wrappedValue = nil // TODO: Test the retry button interference
2632
}

0 commit comments

Comments
 (0)