Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ included:
# Rules – Opt-in only, so we can progressively introduce new ones
#
only_rules:
# Prefer `Array(xs)` over `xs.map { $0 }`.
- array_init

# Colons should be next to the identifier when specifying a type.
- colon

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension BlockEditorSettingsServiceRemote {
func fetchBlockEditorSettings(completion: @escaping BlockEditorSettingsCompletionHandler) {
Task { @MainActor in
let result = await self.remoteAPI.get(path: "/wp-block-editor/v1/settings", parameters: ["context": "mobile"], type: RemoteBlockEditorSettings.self)
.map { settings -> RemoteBlockEditorSettings? in settings }
.map(Optional.some)
.flatMapError { original in
if case let .unparsableResponse(response, _, underlyingError) = original, response?.statusCode == 200, underlyingError is DecodingError {
return .success(nil)
Expand Down