diff --git a/Podfile b/Podfile index 280eb8a2103f..7582a0f5a967 100644 --- a/Podfile +++ b/Podfile @@ -51,7 +51,7 @@ end def wordpress_kit # pod 'WordPressKit', '~> 13.0' - pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: 'dfb2134ca3b91233d44b3551d91844bf2087996f' + pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: '3df47e113c7647b76c049180e39489e3af7a27dc' # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', branch: '' # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', tag: '' # pod 'WordPressKit', path: '../WordPressKit-iOS' diff --git a/Podfile.lock b/Podfile.lock index 027915ebe487..6511715f554b 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -120,7 +120,7 @@ DEPENDENCIES: - SwiftLint (~> 0.50) - WordPress-Editor-iOS (~> 1.19.9) - WordPressAuthenticator (from `https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git`, commit `fa06fca7178b268d382d91861752b3be0729e8a8`) - - WordPressKit (from `https://github.com/wordpress-mobile/WordPressKit-iOS.git`, commit `dfb2134ca3b91233d44b3551d91844bf2087996f`) + - WordPressKit (from `https://github.com/wordpress-mobile/WordPressKit-iOS.git`, commit `3df47e113c7647b76c049180e39489e3af7a27dc`) - WordPressShared (~> 2.3) - WordPressUI (~> 1.15) - ZendeskSupportSDK (= 5.3.0) @@ -178,7 +178,7 @@ EXTERNAL SOURCES: :commit: fa06fca7178b268d382d91861752b3be0729e8a8 :git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git WordPressKit: - :commit: dfb2134ca3b91233d44b3551d91844bf2087996f + :commit: 3df47e113c7647b76c049180e39489e3af7a27dc :git: https://github.com/wordpress-mobile/WordPressKit-iOS.git CHECKOUT OPTIONS: @@ -189,7 +189,7 @@ CHECKOUT OPTIONS: :commit: fa06fca7178b268d382d91861752b3be0729e8a8 :git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git WordPressKit: - :commit: dfb2134ca3b91233d44b3551d91844bf2087996f + :commit: 3df47e113c7647b76c049180e39489e3af7a27dc :git: https://github.com/wordpress-mobile/WordPressKit-iOS.git SPEC CHECKSUMS: @@ -236,6 +236,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: d170fa8e270b2a32bef9dcdcabff5b8f1a5deced -PODFILE CHECKSUM: 91ca97cb58a7ec8391611ea499d341d47f633cda +PODFILE CHECKSUM: f732e6e39fc98112f1812c770b6bb5daf5a73672 COCOAPODS: 1.14.2 diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 0cc165ff8bd7..fd43068ab31d 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -5,6 +5,7 @@ * [**] Multiple pre-publishing sheet fixes and improvements [#22606] * [*] Gravatar: Adds informative new view about Gravatar to the profile editing page. [#22615] * [**] [internal] Refactored .org REST API calls. [#22612] +* [**] [internal] Refactored viewing plugins from self-hosted sites. [#22622] 24.2 ----- diff --git a/WordPress/Classes/Stores/PluginStore.swift b/WordPress/Classes/Stores/PluginStore.swift index d8c909bedd5b..8d2ee0af5b0e 100644 --- a/WordPress/Classes/Stores/PluginStore.swift +++ b/WordPress/Classes/Stores/PluginStore.swift @@ -690,18 +690,17 @@ private extension PluginStore { } func fetchPluginDirectoryEntry(slug: String) { - let remote = PluginDirectoryServiceRemote() state.fetchingDirectoryEntry[slug] = true - remote.getPluginInformation( - slug: slug, - completion: { [actionDispatcher] (result) in - switch result { - case .success(let entry): - actionDispatcher.dispatch(PluginAction.receivePluginDirectoryEntry(slug: slug, entry: entry)) - case .failure(let error): - actionDispatcher.dispatch(PluginAction.receivePluginDirectoryEntryFailed(slug: slug, error: error)) - } - }) + + Task { @MainActor [actionDispatcher] in + do { + let remote = PluginDirectoryServiceRemote() + let entry = try await remote.getPluginInformation(slug: slug) + actionDispatcher.dispatch(PluginAction.receivePluginDirectoryEntry(slug: slug, entry: entry)) + } catch { + actionDispatcher.dispatch(PluginAction.receivePluginDirectoryEntryFailed(slug: slug, error: error)) + } + } } func receivePluginDirectoryEntry(slug: String, entry: PluginDirectoryEntry) { @@ -747,12 +746,12 @@ private extension PluginStore { func fetchPluginDirectoryFeed(feed: PluginDirectoryFeedType) { state.fetchingDirectoryFeed[feed.slug] = true - let remote = PluginDirectoryServiceRemote() - remote.getPluginFeed(feed) { [actionDispatcher] result in - switch result { - case .success(let response): + Task { @MainActor [actionDispatcher] in + do { + let remote = PluginDirectoryServiceRemote() + let response = try await remote.getPluginFeed(feed) actionDispatcher.dispatch(PluginAction.receivePluginDirectoryFeed(feed: feed, response: response)) - case .failure(let error): + } catch { actionDispatcher.dispatch(PluginAction.receivePluginDirectoryFeedFailed(feed: feed, error: error)) } }