Skip to content

Commit 0ace60c

Browse files
committed
Restore a documentation comment that was lost in translation
1 parent bcb7f78 commit 0ace60c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/WordPressKit/Models/RemoteBlogSettings.swift

+4
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,17 @@ public class RemoteBlogSettings: NSObject {
250250
timezoneString = rawSettings[CodingKeys.timezoneString.rawValue] as? String
251251

252252
defaultCategoryID = rawSettings[CodingKeys.defaultCategory.rawValue] as? NSNumber ?? 1
253+
254+
// Note: the backend might send '0' as a number, OR a string value.
255+
// See https://github.com/wordpress-mobile/WordPress-iOS/issues/4187
253256
let defaultPostFormatValue = rawSettings[CodingKeys.defaultPostFormat.rawValue]
254257
if let defaultPostFormatNumber = defaultPostFormatValue as? NSNumber, defaultPostFormatNumber == 0 ||
255258
defaultPostFormatValue as? String == "0" {
256259
defaultPostFormat = "standard"
257260
} else {
258261
defaultPostFormat = defaultPostFormatValue as? String
259262
}
263+
260264
dateFormat = rawSettings[CodingKeys.dateFormat.rawValue] as? String
261265
timeFormat = rawSettings[CodingKeys.timeFormat.rawValue] as? String
262266
startOfWeek = rawSettings[CodingKeys.startOfWeek.rawValue] as? String

0 commit comments

Comments
 (0)