1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 06:10:32 +05:30

Fix offenses

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

View File

@ -80,7 +80,8 @@ extension VideosAPI {
return
}
video(item.videoID).load().onSuccess { response in
video(item.videoID).load()
.onSuccess { response in
guard let video: Video = response.typedContent() else {
return
}
@ -89,7 +90,8 @@ extension VideosAPI {
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")
}
}