-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove context from a few service types #20010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a10ecbc
8b2b3d9
4f9dc21
e667bcb
6e7775c
754dae1
4412706
2b5f7d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,7 +173,7 @@ class PeopleViewController: UITableViewController, UIViewControllerRestoration { | |
| tableView.deselectSelectedRowWithAnimation(true) | ||
| refreshNoResultsView() | ||
|
|
||
| guard let blog = blog else { | ||
| guard let blog else { | ||
| return | ||
| } | ||
|
|
||
|
|
@@ -420,7 +420,7 @@ private extension PeopleViewController { | |
| func loadUsersPage(_ offset: Int = 0, success: @escaping ((_ retrieved: Int, _ shouldLoadMore: Bool) -> Void)) { | ||
| guard let blog = blogInContext, | ||
| let peopleService = PeopleService(blog: blog, coreDataStack: ContextManager.shared), | ||
| let roleService = RoleService(blog: blog, context: viewContext) else { | ||
| let roleService = RoleService(blog: blog, coreDataStack: ContextManager.shared) else { | ||
| return | ||
| } | ||
|
|
||
|
|
@@ -438,7 +438,7 @@ private extension PeopleViewController { | |
| }) | ||
|
|
||
| group.enter() | ||
| roleService.fetchRoles(success: {_ in | ||
| roleService.fetchRoles(success: { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💅 👍 |
||
| group.leave() | ||
| }, failure: { error in | ||
| loadError = error | ||
|
|
@@ -521,11 +521,10 @@ private extension PeopleViewController { | |
| } | ||
|
|
||
| func role(person: Person) -> Role? { | ||
| guard let blog = blog, | ||
| let service = RoleService(blog: blog, context: viewContext) else { | ||
| return nil | ||
| guard let blog = blog else { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going to suggest SwiftLint supports this, I should add the check to our https://github.com/Automattic/swiftlint-config and integrate it here... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No worries. It's always good to have cleaner code. Updated in 4412706 |
||
| return nil | ||
| } | ||
| return service.getRole(slug: person.role) | ||
| return try? Role.lookup(withBlogID: blog.objectID, slug: person.role, in: viewContext) | ||
| } | ||
|
|
||
| func setupFilterBar() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Is it necessary to access
coreDataStackfromselfhere?