This repository was archived by the owner on Sep 20, 2023. It is now read-only.
File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ extension GithubClient {
18
18
repo: String ,
19
19
number: Int ,
20
20
type: IssueMergeType ,
21
- error : @escaping ( ) -> Void
21
+ completionHandler : @escaping ( _ success : Bool ) -> Void
22
22
) {
23
23
let newLabels = IssueLabelsModel (
24
24
status: IssueLabelStatusModel (
@@ -54,9 +54,10 @@ extension GithubClient {
54
54
switch result {
55
55
case . success:
56
56
cache. set ( value: optimisticResult)
57
+ completionHandler ( true )
57
58
case . failure( let err) :
58
59
Squawk . show ( error: err)
59
- error ( )
60
+ completionHandler ( false )
60
61
}
61
62
}
62
63
}
Original file line number Diff line number Diff line change @@ -74,9 +74,14 @@ ListBindingSectionControllerSelectionDelegate {
74
74
repo: model. repo,
75
75
number: model. number,
76
76
type: preferredMergeType,
77
- error: { [ weak self] in
78
- self ? . loading = false
79
- self ? . update ( animated: true )
77
+ completionHandler: { [ weak self] isSuccessfulMerge in
78
+ if isSuccessfulMerge {
79
+ Haptic . triggerNotification ( . success)
80
+ } else {
81
+ self ? . loading = false
82
+ self ? . update ( animated: true )
83
+ Haptic . triggerNotification ( . error)
84
+ }
80
85
} )
81
86
}
82
87
You can’t perform that action at this time.
0 commit comments