Format code
This commit is contained in:
parent
9250dc650d
commit
fcc022ea22
|
@ -8,8 +8,8 @@
|
|||
|
||||
import CoreStore
|
||||
import Foundation
|
||||
import Stinsen
|
||||
import JellyfinAPI
|
||||
import Stinsen
|
||||
|
||||
final class UserSignInViewModel: ViewModel {
|
||||
|
||||
|
|
|
@ -6,24 +6,24 @@
|
|||
// Copyright (c) 2022 Jellyfin & Jellyfin Contributors
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import JellyfinAPI
|
||||
import SwiftUI
|
||||
|
||||
struct UserLoginCellView: View {
|
||||
|
||||
@State
|
||||
private var expanded = false;
|
||||
private var expanded = false
|
||||
|
||||
@State
|
||||
private var enteredPassword: String = ""
|
||||
|
||||
var user: UserDto
|
||||
var baseURL: String?
|
||||
var loginTapped : (String, String) -> Void
|
||||
var loginTapped: (String, String) -> Void
|
||||
var cancelTapped: () -> Void
|
||||
|
||||
var body: some View {
|
||||
DisclosureGroup() {
|
||||
DisclosureGroup {
|
||||
VStack(alignment: .leading, spacing: 16) {
|
||||
SecureField(L10n.password, text: $enteredPassword)
|
||||
Button {
|
||||
|
@ -35,8 +35,7 @@ struct UserLoginCellView: View {
|
|||
.padding(.leading, -16)
|
||||
} label: {
|
||||
HStack(spacing: 4.0) {
|
||||
AsyncImage(
|
||||
url: getProfileImageUrl(),
|
||||
AsyncImage(url: getProfileImageUrl(),
|
||||
content: { image in
|
||||
image.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
|
|
|
@ -22,17 +22,17 @@ struct UserSignInView: View {
|
|||
List {
|
||||
#if !os(tvOS)
|
||||
// DisclosureGroup not available on tvOS
|
||||
if (viewModel.users.count > 0) {
|
||||
if !viewModel.users.isEmpty {
|
||||
Section(header: L10n.knownUsers.text) {
|
||||
ForEach(viewModel.users, id: \.id) { user in
|
||||
UserLoginCellView(user: user, baseURL: viewModel.server.currentURI, loginTapped: viewModel.login, cancelTapped: viewModel.cancelSignIn)
|
||||
UserLoginCellView(user: user, baseURL: viewModel.server.currentURI, loginTapped: viewModel.login,
|
||||
cancelTapped: viewModel.cancelSignIn)
|
||||
.disabled(viewModel.isLoading)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Section {
|
||||
TextField(L10n.username, text: $username)
|
||||
.disableAutocorrection(true)
|
||||
|
|
Loading…
Reference in New Issue