mirror of
https://github.com/yattee/yattee.git
synced 2024-11-14 01:58:24 +00:00
Allow import of accounts to manually added (not imported) instances
This commit is contained in:
parent
7755b392b7
commit
43c8484514
@ -68,7 +68,7 @@ struct LocationsSettingsGroupImporter {
|
|||||||
if let password,
|
if let password,
|
||||||
!password.isEmpty,
|
!password.isEmpty,
|
||||||
let instanceID = account.instanceID,
|
let instanceID = account.instanceID,
|
||||||
let instance = InstancesModel.shared.find(instanceID)
|
let instance = InstancesModel.shared.find(instanceID) ?? InstancesModel.shared.findByURLString(account.urlString)
|
||||||
{
|
{
|
||||||
if !instance.accounts.contains(where: { instanceAccount in
|
if !instance.accounts.contains(where: { instanceAccount in
|
||||||
let (username, _) = instanceAccount.credentials
|
let (username, _) = instanceAccount.credentials
|
||||||
|
@ -62,7 +62,7 @@ struct ImportSettingsAccountRow: View {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Group {
|
Group {
|
||||||
if InstancesModel.shared.find(instanceID) != nil {
|
if InstancesModel.shared.find(instanceID) != nil || InstancesModel.shared.findByURLString(account.urlString) != nil {
|
||||||
HStack {
|
HStack {
|
||||||
Image(systemName: "checkmark.circle.fill")
|
Image(systemName: "checkmark.circle.fill")
|
||||||
.foregroundColor(.green)
|
.foregroundColor(.green)
|
||||||
|
@ -42,7 +42,7 @@ final class ImportSettingsSheetViewModel: ObservableObject {
|
|||||||
|
|
||||||
return ((account.password != nil && !account.password!.isEmpty) ||
|
return ((account.password != nil && !account.password!.isEmpty) ||
|
||||||
importableAccounts.contains(account.id)) && (
|
importableAccounts.contains(account.id)) && (
|
||||||
(InstancesModel.shared.find(instanceID) != nil) ||
|
(InstancesModel.shared.find(instanceID) != nil || InstancesModel.shared.findByURLString(account.urlString) != nil) ||
|
||||||
selectedInstances.contains(instanceID)
|
selectedInstances.contains(instanceID)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user