Fix offenses

This commit is contained in:
Arkadiusz Fal 2022-07-05 19:26:03 +02:00
parent ef47478748
commit f63a0f27fd
4 changed files with 15 additions and 12 deletions

View File

@ -80,16 +80,18 @@ extension VideosAPI {
return
}
video(item.videoID).load().onSuccess { response in
guard let video: Video = response.typedContent() else {
return
video(item.videoID).load()
.onSuccess { response in
guard let video: Video = response.typedContent() else {
return
}
var newItem = item
newItem.video = video
completionHandler(newItem)
}
var newItem = item
newItem.video = video
completionHandler(newItem)
}.onFailure { failureHandler?($0) }
.onFailure { failureHandler?($0) }
}
func shareURL(_ item: ContentItem, frontendHost: String? = nil, time: CMTime? = nil) -> URL? {

View File

@ -1,7 +1,7 @@
import Foundation
import SwiftUI
class SettingsModel: ObservableObject {
final class SettingsModel: ObservableObject {
@Published var presentingAlert = false
@Published var alert = Alert(title: Text("Error"))

View File

@ -136,7 +136,7 @@ struct ControlsOverlay: View {
captionsPicker
.labelsHidden()
.frame(maxWidth: 300)
#else
#elseif os(iOS)
Menu {
captionsPicker
.frame(width: 140, height: 30)

View File

@ -96,7 +96,8 @@ struct LocationsSettings: View {
if let instances: [ManifestedInstance] = response.typedContent() {
self.countries = instances.map(\.country).unique().sorted()
}
}.onFailure { _ in
}
.onFailure { _ in
model.presentAlert(title: "Could not load locations manifest")
}
}