mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-02-06 20:33:20 +01:00
Try to fix domain (IOS-192)
This commit is contained in:
parent
f373506aa3
commit
6cc069ec5b
@ -298,9 +298,9 @@ extension ProfileViewController {
|
||||
// header
|
||||
#warning("TODO: Implement")
|
||||
let headerViewModel = profileHeaderViewController.viewModel!
|
||||
// viewModel.$account
|
||||
// .assign(to: \.account, on: headerViewModel)
|
||||
// .store(in: &disposeBag)
|
||||
viewModel.$account
|
||||
.assign(to: \.account, on: headerViewModel)
|
||||
.store(in: &disposeBag)
|
||||
viewModel.$isEditing
|
||||
.assign(to: \.isEditing, on: headerViewModel)
|
||||
.store(in: &disposeBag)
|
||||
@ -378,11 +378,11 @@ extension ProfileViewController {
|
||||
profileHeaderViewController.profileHeaderView.viewModel.viewDidAppear
|
||||
)
|
||||
.sink { [weak self] (user, _) in
|
||||
guard let self else { return }
|
||||
guard let self, let domain = user.domainFromAcct else { return }
|
||||
Task {
|
||||
_ = try await self.context.apiService.fetchUser(
|
||||
username: user.username,
|
||||
domain: "user.domainFromAcct",
|
||||
domain: domain,
|
||||
authenticationBox: self.authContext.mastodonAuthenticationBox
|
||||
)
|
||||
}
|
||||
|
@ -178,4 +178,15 @@ extension Mastodon.Entity.Account {
|
||||
return !displayName.isEmpty ? displayName : username
|
||||
|
||||
}
|
||||
|
||||
public var domainFromAcct: String? {
|
||||
if acct.contains("@") {
|
||||
return domain
|
||||
} else if let domain = acct.split(separator: "@").last {
|
||||
return String(domain)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user