Skip to content

Commit

Permalink
Restore a documentation comment that was lost in translation
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed Apr 7, 2024
1 parent bcb7f78 commit 0ace60c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/WordPressKit/Models/RemoteBlogSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,17 @@ public class RemoteBlogSettings: NSObject {
timezoneString = rawSettings[CodingKeys.timezoneString.rawValue] as? String

defaultCategoryID = rawSettings[CodingKeys.defaultCategory.rawValue] as? NSNumber ?? 1

// Note: the backend might send '0' as a number, OR a string value.
// See https://github.com/wordpress-mobile/WordPress-iOS/issues/4187
let defaultPostFormatValue = rawSettings[CodingKeys.defaultPostFormat.rawValue]
if let defaultPostFormatNumber = defaultPostFormatValue as? NSNumber, defaultPostFormatNumber == 0 ||
defaultPostFormatValue as? String == "0" {
defaultPostFormat = "standard"
} else {
defaultPostFormat = defaultPostFormatValue as? String
}

dateFormat = rawSettings[CodingKeys.dateFormat.rawValue] as? String
timeFormat = rawSettings[CodingKeys.timeFormat.rawValue] as? String
startOfWeek = rawSettings[CodingKeys.startOfWeek.rawValue] as? String
Expand Down

0 comments on commit 0ace60c

Please sign in to comment.