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 +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,11 @@ final class NotificationModelController {
52
52
completion: @escaping ( Result < ( [ NotificationViewModel ] , Int ? ) > ) -> Void
53
53
) {
54
54
// hack to prevent double-fetching notifications when awaking from bg fetch
55
- guard UIApplication . shared. applicationState != . background else { return }
55
+ guard UIApplication . shared. applicationState != . background else {
56
+ // return success to avoid error states
57
+ completion ( . success( ( [ ] , nil ) ) )
58
+ return
59
+ }
56
60
57
61
let badge = githubClient. badge
58
62
let contentSizeCategory = UIContentSizeCategory . preferred
Original file line number Diff line number Diff line change @@ -31,11 +31,16 @@ final class SplitViewControllerDelegate: UISplitViewControllerDelegate {
31
31
let primaryNav = tab. selectedViewController as? UINavigationController ,
32
32
let secondaryNav = secondaryViewController as? UINavigationController {
33
33
34
- // remove any placeholder VCs from the stack
35
- primaryNav. viewControllers += secondaryNav. viewControllers. filter {
34
+ let collapsedControllers = secondaryNav. viewControllers. filter {
36
35
$0. hidesBottomBarWhenPushed = true
36
+ // remove any placeholder VCs from the stack
37
37
return ( $0 is SplitPlaceholderViewController ) == false
38
38
}
39
+ // avoid setting view controllers b/c can result in viewDidLoad being called
40
+ // https://github.com/GitHawkApp/GitHawk/issues/2230
41
+ if collapsedControllers. count > 0 {
42
+ primaryNav. viewControllers += collapsedControllers
43
+ }
39
44
}
40
45
41
46
return true
You can’t perform that action at this time.
0 commit comments