This repository was archived by the owner on Sep 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ extension GithubClient {
1818 repo: String ,
1919 number: Int ,
2020 type: IssueMergeType ,
21- error : @escaping ( ) -> Void
21+ completionHandler : @escaping ( _ success : Bool ) -> Void
2222 ) {
2323 let newLabels = IssueLabelsModel (
2424 status: IssueLabelStatusModel (
@@ -54,9 +54,10 @@ extension GithubClient {
5454 switch result {
5555 case . success:
5656 cache. set ( value: optimisticResult)
57+ completionHandler ( true )
5758 case . failure( let err) :
5859 Squawk . show ( error: err)
59- error ( )
60+ completionHandler ( false )
6061 }
6162 }
6263 }
Original file line number Diff line number Diff line change @@ -74,9 +74,14 @@ ListBindingSectionControllerSelectionDelegate {
7474 repo: model. repo,
7575 number: model. number,
7676 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+ }
8085 } )
8186 }
8287
You can’t perform that action at this time.
0 commit comments