Skip to content

Commit 37478fe

Browse files
Merge pull request #238 from woocommerce/issue/addressing-prs-feedback
(Late!!) Addressing PR's Feedback
2 parents 06d4838 + a946da3 commit 37478fe

File tree

6 files changed

+9
-20
lines changed

6 files changed

+9
-20
lines changed

Networking/Networking/Model/Order.swift

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,8 @@ public struct Order: Decodable {
117117

118118
let items = try container.decode([OrderItem].self, forKey: .items)
119119

120-
var shippingAddress: Address? = nil
121-
do {
122-
shippingAddress = try container.decodeIfPresent(Address.self, forKey: .shippingAddress)
123-
} catch {
124-
// no-op
125-
}
126-
127-
var billingAddress: Address? = nil
128-
do {
129-
billingAddress = try container.decode(Address.self, forKey: .billingAddress)
130-
} catch {
131-
billingAddress = Address(firstName: "", lastName: "", company: "", address1: "", address2: "", city: "", state: "", postcode: "", country: "", phone: "", email: "")
132-
}
120+
let shippingAddress = try? container.decode(Address.self, forKey: .shippingAddress)
121+
let billingAddress = try? container.decode(Address.self, forKey: .billingAddress)
133122

134123
let coupons = try container.decode([OrderCouponLine].self, forKey: .couponLines)
135124

Networking/Networking/Network/AlamofireNetwork.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class AlamofireNetwork: Network {
6161
///
6262
private extension Alamofire.DataResponse {
6363

64-
/// Returns `NetworkError.notFound` whenever the Request failed with a 404 StatusCode. This may be used by upper layers,
64+
/// Returns `NetworkError.notFound` whenever the Request failed with a 404 StatusCode. This may be used by upper layers,
6565
/// to determine if an object should be deleted (for instance!).
6666
///
6767
/// In any other case, this property will actually return the regular `DataResponse.error` result.

Networking/Networking/Network/MockupNetwork.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ extension MockupNetwork {
8888
responseMap[requestUrlSuffix] = filename
8989
}
9090

91-
/// We'll return the specified Error, whenever a request matches the specified Suffix Criteria!.
91+
/// We'll return the specified Error, whenever a request matches the specified Suffix Criteria!
9292
///
9393
func simulateError(requestUrlSuffix: String, error: Error) {
9494
errorMap[requestUrlSuffix] = error

WooCommerce/Classes/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private extension AppDelegate {
133133

134134
// Take advantage of a bug in UIAlertController
135135
// to style all UIAlertControllers with WC color
136-
self.window?.tintColor = StyleManager.wooCommerceBrandColor
136+
window?.tintColor = StyleManager.wooCommerceBrandColor
137137
}
138138

139139
/// Sets up FancyButton's UIAppearance.

WooCommerce/Classes/ViewRelated/Dashboard/Settings/SettingsViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class SettingsViewController: UIViewController {
6868
func logOutUser() {
6969
WooAnalytics.shared.track(.logout)
7070
StoresManager.shared.deauthenticate()
71-
self.navigationController?.popToRootViewController(animated: true)
71+
navigationController?.popToRootViewController(animated: true)
7272
}
7373
}
7474

@@ -100,12 +100,12 @@ extension SettingsViewController: UITableViewDataSource {
100100
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
101101
let row = sections[indexPath.section].rows[indexPath.row]
102102
let cell = tableView.dequeueReusableCell(withIdentifier: row.reuseIdentifier, for: indexPath)
103-
if cell is LogOutTableViewCell {
104-
let logoutCell = cell as! LogOutTableViewCell
103+
if let logoutCell = cell as? LogOutTableViewCell {
105104
logoutCell.didSelectLogout = { [weak self] in
106105
self?.handleLogout()
107106
}
108107
}
108+
109109
return cell
110110
}
111111

Yosemite/YosemiteTests/Stores/OrderStoreTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class OrderStoreTests: XCTestCase {
280280
}
281281

282282
/// Verifies that whenever a `retrieveOrder` action results in a response with statusCode = 404, the local entity
283-
/// is obliterated from existance.
283+
/// is obliterated from existence.
284284
///
285285
func testRetrieveSingleOrderResultingInStatusCode404CausesTheStoredOrderToGetDeleted() {
286286
let expectation = self.expectation(description: "Retrieve single order empty response")

0 commit comments

Comments
 (0)