Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Classes/Issues/Merge/GithubClient+Merge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extension GithubClient {
repo: String,
number: Int,
type: IssueMergeType,
error: @escaping () -> Void
completionHandler: @escaping (_ success: Bool) -> Void
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you ignore it still? That wouldn't help to understand it at the call site 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BasThomas functional type can't have a argument label. If you ask about it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah.

) {
let newLabels = IssueLabelsModel(
status: IssueLabelStatusModel(
Expand Down Expand Up @@ -54,9 +54,10 @@ extension GithubClient {
switch result {
case .success:
cache.set(value: optimisticResult)
completionHandler(true)
case .failure(let err):
Squawk.show(error: err)
error()
completionHandler(false)
}
}
}
Expand Down
11 changes: 8 additions & 3 deletions Classes/Issues/Merge/IssueMergeSectionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@ ListBindingSectionControllerSelectionDelegate {
repo: model.repo,
number: model.number,
type: preferredMergeType,
error: { [weak self] in
self?.loading = false
self?.update(animated: true)
completionHandler: { [weak self] isSuccessfulMerge in
if isSuccessfulMerge {
Haptic.triggerNotification(.success)
} else {
self?.loading = false
self?.update(animated: true)
Haptic.triggerNotification(.error)
}
})
}

Expand Down