Skip to content

Commit 9caf1fd

Browse files
author
Darin Krauss
authored
Partial fix for alerts presented by stale root view controller (#379)
1 parent da0fe9a commit 9caf1fd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Loop/Managers/LoopAppManager.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,12 @@ class LoopAppManager: NSObject {
160160
statusTableViewController.deviceManager = deviceDataManager
161161
bluetoothStateManager.addBluetoothObserver(statusTableViewController)
162162

163-
let rootNavigationController = RootNavigationController()
164-
rootViewController = rootNavigationController
165-
rootNavigationController.setViewControllers([statusTableViewController], animated: true)
163+
var rootNavigationController = rootViewController as? RootNavigationController
164+
if rootNavigationController == nil {
165+
rootNavigationController = RootNavigationController()
166+
rootViewController = rootNavigationController
167+
}
168+
rootNavigationController?.setViewControllers([statusTableViewController], animated: true)
166169

167170
handleRemoteNotificationFromLaunchOptions()
168171

0 commit comments

Comments
 (0)