Skip to content

Commit 86e21f9

Browse files
committed
Ensure JCP API workarounds succeed before applying site changes.
1 parent be68d6f commit 86e21f9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Yosemite/Yosemite/Stores/AccountStore.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ private extension AccountStore {
140140
.map {
141141
(site, isWooCommerceActiveResult, wpSiteSettingsResult) -> Site in
142142
var site = site
143-
if case let .success(isWooCommerceActive) = isWooCommerceActiveResult {
144-
site = site.copy(isWooCommerceActive: isWooCommerceActive)
145-
}
146-
if case let .success(wpSiteSettings) = wpSiteSettingsResult {
147-
site = site.copy(name: wpSiteSettings.name, description: wpSiteSettings.description, url: wpSiteSettings.url)
148-
}
143+
guard case let .success(isWooCommerceActive) = isWooCommerceActiveResult,
144+
case let .success(wpSiteSettings) = wpSiteSettingsResult else {
145+
return site
146+
}
147+
site = site.copy(isWooCommerceActive: isWooCommerceActive)
148+
site = site.copy(name: wpSiteSettings.name, description: wpSiteSettings.description, url: wpSiteSettings.url)
149149
return site
150150
}.eraseToAnyPublisher()
151151
} else {

0 commit comments

Comments
 (0)