mirror of
https://github.com/yattee/yattee.git
synced 2026-11-01 01:17:20 +00:00
Tell the accounts apart, and let a disabled source come back
This commit is contained in:
@@ -329,13 +329,13 @@ private struct EditRemoteServerContent: View {
|
||||
.presentationCompactAdaptation(.sheet)
|
||||
#if os(tvOS)
|
||||
.fullScreenCover(item: $loginTarget) { target in
|
||||
InstanceLoginView(instance: instance) { credential, username in
|
||||
InstanceLoginView(instance: instance, initialUsername: storedUsername(for: target)) { credential, username in
|
||||
storeLogin(credential: credential, username: username, target: target)
|
||||
}
|
||||
}
|
||||
#else
|
||||
.sheet(item: $loginTarget) { target in
|
||||
InstanceLoginView(instance: instance) { credential, username in
|
||||
InstanceLoginView(instance: instance, initialUsername: storedUsername(for: target)) { credential, username in
|
||||
storeLogin(credential: credential, username: username, target: target)
|
||||
}
|
||||
}
|
||||
@@ -417,6 +417,13 @@ private struct EditRemoteServerContent: View {
|
||||
return stored
|
||||
}
|
||||
|
||||
/// The identifier an existing account last signed in with, when this device
|
||||
/// holds it. A new account has nobody to name yet.
|
||||
private func storedUsername(for target: AccountLoginTarget) -> String? {
|
||||
guard let account = target.account else { return nil }
|
||||
return appEnvironment?.accountCredentialsManager(for: account)?.username(for: account)
|
||||
}
|
||||
|
||||
private func loadServerInfo() async {
|
||||
guard instance.type == .yatteeServer, let appEnvironment else { return }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user