Skip to content

Commit

Permalink
Merge branch 'trunk' into task/update-gifu
Browse files Browse the repository at this point in the history
  • Loading branch information
kean authored Jul 21, 2023
2 parents 85b92f3 + bef6348 commit d4c4c29
Show file tree
Hide file tree
Showing 111 changed files with 1,215 additions and 747 deletions.
2 changes: 1 addition & 1 deletion Gutenberg/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# LOCAL_GUTENBERG=../my-gutenberg-fork bundle exec pod install
GUTENBERG_CONFIG = {
# commit: ''
tag: 'v1.100.0-alpha1'
tag: 'v1.100.1'
}

GITHUB_ORG = 'wordpress-mobile'
Expand Down
204 changes: 102 additions & 102 deletions Podfile.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* [*] Fix a memory leak caused by the theme customization web view. [#21051]
* [*] [Jetpack-only] Made performance improvements for Posting Activity stats. [#21136]
* [*] Fixed a crash that could occur when following sites in Reader. [#21140]
* [*] Fixed a crash that occurs in Weekly Roundup Background task due to a Core Data Concurrency violation. [#21076]
* [***] Block editor: Editor UX improvements with new icons, colors and additional design enhancements. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5985]

22.8
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,20 @@ open class NotificationSettings {
///
public let streams: [Stream]

/// Maps to the associated blog, if any.
/// The associated blog. This property is not thread-safe.
///
/// If you need to access this property from a thread different from the one it was created on, don't access it directly. Instead, use the `blogManagedObjectID`
/// with `context.existingObject(with: blogManagedObjectID)` to retrieve the corresponding managed object in a thread-safe manner.
///
public let blog: Blog?

/// The managed object identifier for the associated blog. This property serves as a thread-safe version of the `blog` property.
///
/// Rather than directly accessing the `blog` property from a different thread than the one it was created on, use this identifier with
/// `context.existingObject(with: blogManagedObjectID)` to retrieve the corresponding managed object in a thread-safe manner.
///
public let blogManagedObjectID: NSManagedObjectID?

/// The settings that are stored locally
///
static let locallyStoredKeys: [String] = [
Expand All @@ -37,6 +47,7 @@ open class NotificationSettings {
self.channel = channel
self.streams = streams
self.blog = blog
self.blogManagedObjectID = blog?.objectID
}


Expand Down
16 changes: 8 additions & 8 deletions WordPress/Classes/Services/NotificationSettingsService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class NotificationSettingsService {
/// - Parameter managedObjectContext: A Reference to the MOC that should be used to interact with the Core Data Stack.
///
public convenience init(coreDataStack: CoreDataStack) {
var remoteApi: WordPressComRestApi? = nil

if let defaultAccount = try? WPAccount.lookupDefaultWordPressComAccount(in: coreDataStack.mainContext),
defaultAccount.authToken != nil,
let restApi = defaultAccount.wordPressComRestApi,
restApi.hasCredentials() {
remoteApi = restApi
let remoteApi = coreDataStack.performQuery { context -> WordPressComRestApi? in
guard let defaultAccount = try? WPAccount.lookupDefaultWordPressComAccount(in: context),
defaultAccount.authToken != nil,
let restApi = defaultAccount.wordPressComRestApi,
restApi.hasCredentials() else {
return nil
}
return restApi
}

self.init(coreDataStack: coreDataStack, wordPressComRestApi: remoteApi)
}

Expand Down
Loading

0 comments on commit d4c4c29

Please sign in to comment.