mirror of
https://github.com/metabolist/metatext.git
synced 2025-02-17 22:45:13 +00:00
spelling: identity
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
parent
16832f7264
commit
3002725428
2 changed files with 9 additions and 9 deletions
|
@ -11,7 +11,7 @@ enum IdentitiesSection: Hashable {
|
|||
|
||||
enum IdentitiesItem: Hashable {
|
||||
case add
|
||||
case identitiy(Identity)
|
||||
case identity(Identity)
|
||||
}
|
||||
|
||||
final class IdentitiesDataSource: UITableViewDiffableDataSource<IdentitiesSection, IdentitiesItem> {
|
||||
|
@ -39,7 +39,7 @@ final class IdentitiesDataSource: UITableViewDiffableDataSource<IdentitiesSectio
|
|||
configuration.text = NSLocalizedString("add", comment: "")
|
||||
configuration.image = UIImage(systemName: "plus.circle.fill")
|
||||
cell.contentConfiguration = configuration
|
||||
case let .identitiy(identity):
|
||||
case let .identity(identity):
|
||||
let viewModel = viewModelProvider(identity)
|
||||
|
||||
(cell as? IdentityTableViewCell)?.viewModel = viewModel
|
||||
|
@ -83,11 +83,11 @@ private extension IdentitiesDataSource {
|
|||
var newSnapshot = NSDiffableDataSourceSnapshot<IdentitiesSection, IdentitiesItem>()
|
||||
let sections = [
|
||||
(section: IdentitiesSection.identities(NSLocalizedString("identities.accounts", comment: "")),
|
||||
identities: identities.filter { $0.authenticated && !$0.pending }.map(IdentitiesItem.identitiy)),
|
||||
identities: identities.filter { $0.authenticated && !$0.pending }.map(IdentitiesItem.identity)),
|
||||
(section: IdentitiesSection.identities(NSLocalizedString("identities.browsing", comment: "")),
|
||||
identities: identities.filter { !$0.authenticated && !$0.pending }.map(IdentitiesItem.identitiy)),
|
||||
identities: identities.filter { !$0.authenticated && !$0.pending }.map(IdentitiesItem.identity)),
|
||||
(section: IdentitiesSection.identities(NSLocalizedString("identities.pending", comment: "")),
|
||||
identities: identities.filter { $0.pending }.map(IdentitiesItem.identitiy))
|
||||
identities: identities.filter { $0.pending }.map(IdentitiesItem.identity))
|
||||
]
|
||||
.filter { !$0.identities.isEmpty }
|
||||
|
||||
|
@ -107,7 +107,7 @@ private extension IdentitiesItem {
|
|||
switch self {
|
||||
case .add:
|
||||
return String(describing: UITableViewCell.self)
|
||||
case .identitiy:
|
||||
case .identity:
|
||||
return String(describing: IdentityTableViewCell.self)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ final class IdentitiesViewController: UITableViewController {
|
|||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, shouldHighlightRowAt indexPath: IndexPath) -> Bool {
|
||||
if case let .identitiy(identityViewModel) = dataSource.itemIdentifier(for: indexPath) {
|
||||
if case let .identity(identityViewModel) = dataSource.itemIdentifier(for: indexPath) {
|
||||
return identityViewModel.id != viewModel.identityContext.identity.id
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ final class IdentitiesViewController: UITableViewController {
|
|||
let addIdentityViewController = UIHostingController(rootView: addIdentityView)
|
||||
|
||||
show(addIdentityViewController, sender: self)
|
||||
case let .identitiy(identityViewModel):
|
||||
case let .identity(identityViewModel):
|
||||
rootViewModel.identitySelected(id: identityViewModel.id)
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ final class IdentitiesViewController: UITableViewController {
|
|||
let logOutAction = UIContextualAction(
|
||||
style: .destructive,
|
||||
title: NSLocalizedString("identities.log-out", comment: "")) { [weak self] _, _, completionHandler in
|
||||
guard let self = self, case let .identitiy(identity) = self.dataSource.itemIdentifier(for: indexPath) else {
|
||||
guard let self = self, case let .identity(identity) = self.dataSource.itemIdentifier(for: indexPath) else {
|
||||
completionHandler(false)
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue