Skip to content

Commit

Permalink
Fix an issue with BlogDashboardPersonalizationService being used on t…
Browse files Browse the repository at this point in the history
…he background thread (#22335)
  • Loading branch information
kean authored Jan 5, 2024
2 parents ae6b203 + 19e4234 commit 3431c32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* [*] Fix a rare crash in post search related to tags [#22275]
* [*] Fix a rare crash when deleting posts [#22277]
* [*] Fix a rare crash in Site Media prefetching cancellation [#22278]
* [*] Fix an issue with BlogDashboardPersonalizationService being used on the background thread [#22335]
* [***] Block Editor: Avoid keyboard dismiss when interacting with text blocks [https://github.com/WordPress/gutenberg/pull/57070]
* [**] Block Editor: Auto-scroll upon block insertion [https://github.com/WordPress/gutenberg/pull/57273]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ public class BloggingPromptSettings: NSManagedObject {
}

private func updatePromptSettingsIfNecessary(siteID: Int, enabled: Bool) {
let service = BlogDashboardPersonalizationService(siteID: siteID)
if !service.hasPreference(for: .prompts) {
service.setEnabled(enabled, for: .prompts)
DispatchQueue.main.async {
let service = BlogDashboardPersonalizationService(siteID: siteID)
if !service.hasPreference(for: .prompts) {
service.setEnabled(enabled, for: .prompts)
}
}
}

}

extension RemoteBloggingPromptsSettings {
Expand Down

0 comments on commit 3431c32

Please sign in to comment.