mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 05:02:53 +00:00
Keep the tvOS media browser header visible while loading
The Refresh and View Options header was hidden until the first listing arrived, leaving only a spinner; an SMB or WebDAV connection can hang for a long time with nothing the remote could focus. Refresh ignores presses while a load is in flight.
This commit is contained in:
@@ -152,30 +152,32 @@ struct MediaBrowserView: View {
|
||||
title: navigationTitle
|
||||
) {
|
||||
VStack(spacing: 0) {
|
||||
if !(isLoading && files.isEmpty) {
|
||||
HStack(spacing: 24) {
|
||||
Button {
|
||||
Task { await loadFiles() }
|
||||
} label: {
|
||||
Label(String(localized: "common.refresh"), systemImage: "arrow.clockwise")
|
||||
}
|
||||
Button {
|
||||
showViewOptions = true
|
||||
} label: {
|
||||
Label(
|
||||
String(localized: "viewOptions.title"),
|
||||
systemImage: showOnlyPlayable
|
||||
? "line.3.horizontal.decrease.circle.fill"
|
||||
: "line.3.horizontal.decrease.circle"
|
||||
)
|
||||
}
|
||||
Spacer()
|
||||
// Shown while the first listing loads too: an SMB or WebDAV
|
||||
// connection can hang for a long time, and the spinner alone
|
||||
// gives the remote nothing to focus.
|
||||
HStack(spacing: 24) {
|
||||
Button {
|
||||
guard !isLoading else { return }
|
||||
Task { await loadFiles() }
|
||||
} label: {
|
||||
Label(String(localized: "common.refresh"), systemImage: "arrow.clockwise")
|
||||
}
|
||||
.padding(.horizontal, 24)
|
||||
.padding(.top, 16)
|
||||
.padding(.bottom, 8)
|
||||
.focusSection()
|
||||
Button {
|
||||
showViewOptions = true
|
||||
} label: {
|
||||
Label(
|
||||
String(localized: "viewOptions.title"),
|
||||
systemImage: showOnlyPlayable
|
||||
? "line.3.horizontal.decrease.circle.fill"
|
||||
: "line.3.horizontal.decrease.circle"
|
||||
)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
.padding(.horizontal, 24)
|
||||
.padding(.top, 16)
|
||||
.padding(.bottom, 8)
|
||||
.focusSection()
|
||||
inner
|
||||
.focusSection()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user