Skip to content
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

fix(module: modal): throw error when using ModalService if not set ModalOptions.AfterClose (#807) #809

Merged
merged 2 commits into from
Nov 22, 2020

Conversation

zxyao145
Copy link
Member

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

#807

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Inspection before use ModalOptions.AfterClose Is it null
🇨🇳 Chinese 使用前检查ModalOptions.AfterClose是否为null

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

…lazor#807)

If ModalOptions.AfterClose is null, the exception will be thrown: delegate to an instance method cannot have null 'this'
@zxyao145 zxyao145 linked an issue Nov 19, 2020 that may be closed by this pull request
@codecov-io
Copy link

Codecov Report

Merging #809 (a2f7262) into master (6186e93) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #809      +/-   ##
=========================================
- Coverage    3.66%   3.66%   -0.01%     
=========================================
  Files         395     395              
  Lines       17515   17518       +3     
=========================================
  Hits          642     642              
- Misses      16873   16876       +3     
Impacted Files Coverage Δ
components/modal/ModalContainer.razor 0.00% <ø> (ø)
components/modal/config/ModalOptions.cs 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6186e93...a2f7262. Read the comment docs.

@@ -31,6 +31,11 @@ public class ModalOptions

public Func<Task> AfterClose { get; set; }

internal Func<Task> GetAfterClose()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用自动属性或者直接赋值 AfterClose ?? (() => Task.CompletedTask) 性能高一点,不然每次渲染都要执行方法

Copy link
Member

@ElderJames ElderJames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ElderJames ElderJames merged commit 09f88f9 into ant-design-blazor:master Nov 22, 2020
ElderJames pushed a commit that referenced this pull request Apr 23, 2022
…dalOptions.AfterClose (#807) (#809)

* fix(module: modal): throw error when using ModalService (#807)

If ModalOptions.AfterClose is null, the exception will be thrown: delegate to an instance method cannot have null 'this'

* refactor: use automatic properties for  ModalOptions
ElderJames pushed a commit that referenced this pull request Apr 30, 2022
…dalOptions.AfterClose (#807) (#809)

* fix(module: modal): throw error when using ModalService (#807)

If ModalOptions.AfterClose is null, the exception will be thrown: delegate to an instance method cannot have null 'this'

* refactor: use automatic properties for  ModalOptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ModalService.CreateModal throws error
3 participants