Improvements.

This commit is contained in:
Marcin Czachursk 2023-02-01 13:35:29 +01:00
parent 9e642b3c15
commit ac785ae84b
2 changed files with 37 additions and 8 deletions

View File

@ -11,6 +11,41 @@ public class InstanceService {
public static let shared = InstanceService()
private init() { }
public let pixelfedInstances: [String] = [
"https://pixelfed.de",
"https://pixelfed.social",
"https://pxlmo.com",
"https://metapixl.com",
"https://pixey.org",
"https://pixel.tchncs.de",
"https://pixelfed.tokyo",
"https://pixelfed.fr",
"https://pixelfed.nz",
"https://pixelfed.au",
"https://pixelfed.eus",
"https://pixelfed.bachgau.social",
"https://pixelfed.es",
"https://pixelfed.cz",
"https://pixelfed.automat.click",
"https://gram.social",
"https://nixorigin.one",
"https://miniature.photography",
"https://fedifilm.art",
"https://fedipix.de",
"https://pixel.jabbxi.de",
"https://nodegray.com",
"https://socialpixels.xyz",
"https://pixel.mamutut.space",
"https://pixelfed.fioverse.zone",
"https://pixel.artemai.art",
"https://pix.anduin.net",
"https://jauntypix.net",
"https://faf.photos",
"https://pix.vleij.com",
"https://pixels.gsi.li",
"https://eorzea.photos"
]
func instances(urls: [String]) async -> [Instance] {
var instances: [Instance] = []

View File

@ -15,13 +15,7 @@ struct SignInView: View {
@State private var serverAddress: String = String.empty()
@State private var instances: [Instance] = []
private let pixelfedInstances: [String] = [
"https://pixelfed.de", "https://pixelfed.social", "https://pxlmo.com", "https://metapixl.com", "https://pixey.org",
"https://pixel.tchncs.de", "https://pixelfed.tokyo", "https://pixelfed.fr", "https://pixelfed.nz", "https://pixelfed.au",
"https://pixelfed.eus", "https://pixelfed.bachgau.social"
]
var onSignInStateChenge: ((_ applicationViewMode: ApplicationViewMode) -> Void)?
var body: some View {
@ -70,7 +64,7 @@ struct SignInView: View {
}
.onFirstAppear {
self.instances = await InstanceService.shared.instances(urls: self.pixelfedInstances)
self.instances = await InstanceService.shared.instances(urls: InstanceService.shared.pixelfedInstances)
}
.navigationBarTitle("Sign in to Pixelfed")
.navigationBarTitleDisplayMode(.inline)