mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Code style changes
This commit is contained in:
@@ -327,7 +327,7 @@ struct ChannelVideosView: View {
|
||||
|
||||
private var contentTypePicker: some View {
|
||||
Picker("Content type", selection: $contentType) {
|
||||
if let channel = presentedChannel {
|
||||
if presentedChannel != nil {
|
||||
ForEach(Channel.ContentType.allCases, id: \.self) { type in
|
||||
if typeAvailable(type) {
|
||||
Label(type.description, systemImage: type.systemImage).tag(type)
|
||||
@@ -432,18 +432,20 @@ struct ChannelVideosView: View {
|
||||
}
|
||||
|
||||
func load() {
|
||||
resource?.load().onSuccess { response in
|
||||
if let page: ChannelPage = response.typedContent() {
|
||||
if let channel = page.channel {
|
||||
ChannelsCacheModel.shared.store(channel)
|
||||
resource?
|
||||
.load()
|
||||
.onSuccess { response in
|
||||
if let page: ChannelPage = response.typedContent() {
|
||||
if let channel = page.channel {
|
||||
ChannelsCacheModel.shared.store(channel)
|
||||
}
|
||||
self.page = page
|
||||
self.contentTypeItems.replace(page.results)
|
||||
}
|
||||
self.page = page
|
||||
self.contentTypeItems.replace(page.results)
|
||||
}
|
||||
}
|
||||
.onFailure { error in
|
||||
navigation.presentAlert(title: "Could not load channel data", message: error.userMessage)
|
||||
}
|
||||
.onFailure { error in
|
||||
navigation.presentAlert(title: "Could not load channel data", message: error.userMessage)
|
||||
}
|
||||
}
|
||||
|
||||
func loadNextPage() {
|
||||
|
@@ -16,7 +16,7 @@ struct DocumentsView: View {
|
||||
|
||||
Group {
|
||||
if model.isDirectory(standardizedURL) {
|
||||
NavigationLink(destination: DocumentsView(directoryURL: url)) {
|
||||
NavigationLink(destination: Self(directoryURL: url)) {
|
||||
VideoBanner(video: video)
|
||||
}
|
||||
} else {
|
||||
|
@@ -4,7 +4,7 @@ import Siesta
|
||||
|
||||
struct OpenURLHandler {
|
||||
static var firstHandle = true
|
||||
static var shared = OpenURLHandler()
|
||||
static var shared = Self()
|
||||
static let yatteeProtocol = "yattee://"
|
||||
|
||||
var accounts: AccountsModel { .shared }
|
||||
|
@@ -5,8 +5,7 @@ import SwiftUI
|
||||
#if os(iOS)
|
||||
struct AppleAVPlayerView: UIViewRepresentable {
|
||||
func makeUIView(context _: Context) -> some UIView {
|
||||
let playerLayerView = PlayerLayerView(frame: .zero)
|
||||
return playerLayerView
|
||||
PlayerLayerView(frame: .zero)
|
||||
}
|
||||
|
||||
func updateUIView(_: UIViewType, context _: Context) {}
|
||||
|
@@ -204,7 +204,7 @@ struct CommentView: View {
|
||||
Group {
|
||||
let last = comments.replies.last
|
||||
ForEach(comments.replies) { comment in
|
||||
CommentView(comment: comment, repliesID: $repliesID)
|
||||
Self(comment: comment, repliesID: $repliesID)
|
||||
#if os(tvOS)
|
||||
.focusable()
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user