File tree 1 file changed +4
-0
lines changed
Sources/WordPressKit/Models
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -250,13 +250,17 @@ public class RemoteBlogSettings: NSObject {
250
250
timezoneString = rawSettings [ CodingKeys . timezoneString. rawValue] as? String
251
251
252
252
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
253
256
let defaultPostFormatValue = rawSettings [ CodingKeys . defaultPostFormat. rawValue]
254
257
if let defaultPostFormatNumber = defaultPostFormatValue as? NSNumber , defaultPostFormatNumber == 0 ||
255
258
defaultPostFormatValue as? String == " 0 " {
256
259
defaultPostFormat = " standard "
257
260
} else {
258
261
defaultPostFormat = defaultPostFormatValue as? String
259
262
}
263
+
260
264
dateFormat = rawSettings [ CodingKeys . dateFormat. rawValue] as? String
261
265
timeFormat = rawSettings [ CodingKeys . timeFormat. rawValue] as? String
262
266
startOfWeek = rawSettings [ CodingKeys . startOfWeek. rawValue] as? String
You can’t perform that action at this time.
0 commit comments