-
-
Notifications
You must be signed in to change notification settings - Fork 363
feat(SweetAlert): support trigger OnCloseAsync when set IsAutoHide to true #5040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's Guide by SourceryThis PR allows SweetAlert to trigger the OnCloseAsync callback when IsAutoHide is set to true, addressing issue #5035. This change ensures that asynchronous close callbacks are supported when auto-hiding is enabled. Sequence diagram for SweetAlert auto-hide with OnCloseAsyncsequenceDiagram
participant Component
participant SweetAlert
participant ModalContainer
Component->>SweetAlert: Show(SwalOption)
Note over SweetAlert: Check IsAutoHide & Delay
SweetAlert->>SweetAlert: Set OnCloseCallbackAsync
SweetAlert->>ModalContainer: Show Dialog
Note over SweetAlert: Wait for Delay
SweetAlert->>ModalContainer: Close
SweetAlert->>SweetAlert: Execute OnCloseCallbackAsync
Class diagram for SweetAlert component changesclassDiagram
class SweetAlert {
-bool IsShowDialog
-CancellationTokenSource DelayToken
-Func~Task~ OnCloseCallbackAsync
+Task OnAfterRenderAsync(bool firstRender)
-bool AutoHideCheck()
-Task Show(SwalOption option)
}
class SwalOption {
+string Title
+string Content
+Func~Task~ OnCloseAsync
+Func~Task~ OnConfirmAsync
}
SweetAlert ..> SwalOption
note for SweetAlert "Added OnCloseCallbackAsync to handle auto-hide close events"
State diagram for SweetAlert auto-hide behaviorstateDiagram-v2
[*] --> Closed
Closed --> Showing: Show(SwalOption)
Showing --> AutoHiding: IsAutoHide & Delay > 0
Showing --> Displayed: !IsAutoHide
AutoHiding --> Closed: After Delay
Displayed --> Closed: Manual Close
note right of AutoHiding: Now triggers OnCloseAsync
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Co-Authored-By: ice6 <[email protected]>
|
@sourcery-ai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ArgoZhang - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5040 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 631 631
Lines 27957 27964 +7
Branches 4006 4008 +2
=========================================
+ Hits 27957 27964 +7 ☔ View full report in Codecov by Sentry. |
support trigger OnCloseAsync when set IsAutoHide to true
Summary of the changes (Less than 80 chars)
简单描述你更改了什么, 不超过80个字符;如果有关联 Issue 请在下方填写相关编号
Description
fixes #5035
Regression?
[If yes, specify the version the behavior has regressed from]
[是否影响老版本]
Risk
[Justify the selection above]
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Allow SweetAlert to trigger OnCloseAsync callback when IsAutoHide is set to true.
New Features:
Tests: