Merge pull request #32 from tootsuite/fix/30

fix: #30
This commit is contained in:
BradGao 2021-03-01 18:02:54 +08:00 committed by GitHub
commit 5e3939853d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 6 deletions

View File

@ -103,7 +103,9 @@ extension MastodonPickServerViewController {
.sink { _ in
} receiveValue: { [weak self] servers in
self?.tableView.beginUpdates()
self?.tableView.reloadSections(IndexSet(integer: 3), with: .automatic)
self?.tableView.endUpdates()
if let selectedServer = self?.viewModel.selectedServer.value, servers.contains(selectedServer) {
// Previously selected server is still in the list, do nothing
} else {
@ -291,8 +293,7 @@ extension MastodonPickServerViewController: UITableViewDelegate {
// Same reason as above
return 10
case .serverList:
// Header with 1 height as the separator
return 1
return 0
}
}

View File

@ -80,8 +80,6 @@ class MastodonPickServerViewModel: NSObject {
weak var tableView: UITableView?
// private var expandServerDomainSet = Set<String>()
var mastodonPinBasedAuthenticationViewController: UIViewController?
init(context: AppContext, mode: PickServerMode) {

View File

@ -231,7 +231,7 @@ extension PickServerCell {
// Set bottom separator
seperator.leadingAnchor.constraint(equalTo: containerView.leadingAnchor),
containerView.trailingAnchor.constraint(equalTo: seperator.trailingAnchor),
containerView.bottomAnchor.constraint(equalTo: seperator.bottomAnchor),
containerView.topAnchor.constraint(equalTo: seperator.topAnchor),
seperator.heightAnchor.constraint(equalToConstant: 1).priority(.defaultHigh),
domainLabel.topAnchor.constraint(equalTo: containerView.layoutMarginsGuide.topAnchor),

View File

@ -47,7 +47,7 @@ extension Mastodon.Entity {
case approvalRequired = "approval_required"
case invitesEnabled = "invites_enabled"
case urls
case statistics
case statistics = "stats"
case thumbnail
case contactAccount = "contact_account"