Initial PeerTube Support

This commit is contained in:
Arkadiusz Fal
2022-12-09 01:15:19 +01:00
parent 72ea17b257
commit faf2469e04
39 changed files with 816 additions and 92 deletions

View File

@@ -58,7 +58,7 @@ struct SearchView: View {
VStack {
SearchTextField(favoriteItem: $favoriteItem)
if state.query.query != state.queryText {
if accounts.app.supportsSearchSuggestions, state.query.query != state.queryText {
SearchSuggestions()
.opacity(state.queryText.isEmpty ? 0 : 1)
} else {
@@ -72,7 +72,7 @@ struct SearchView: View {
results
#if os(macOS)
if state.query.query != state.queryText {
if accounts.app.supportsSearchSuggestions, state.query.query != state.queryText {
HStack {
Spacer()
SearchSuggestions()
@@ -122,6 +122,9 @@ struct SearchView: View {
state.store.replace(ContentItem.array(of: videos))
}
}
.onChange(of: accounts.current) { _ in
state.reloadQuery()
}
.onChange(of: state.queryText) { newQuery in
if newQuery.isEmpty {
favoriteItem = nil