Fix state restoration
@@ -102,15 +102,16 @@ extension SceneDelegate {
_ = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true, block: { (timer) in
if let doc = self.documentBrowserViewController, doc.view.window != nil {
- let sidebar = doc.makeSidebarNavigation(url: url, run: false, isShortcut: false)
- let vc = UIHostingController(rootView: sidebar)
+ let sidebar = doc.makeSidebarNavigation(url: url, run: false, isShortcut: false, restoreSelection: true)
+ let vc = UIHostingController(rootView: AnyView(sidebar))
vc.modalPresentationStyle = .fullScreen
vc.modalTransitionStyle = .crossDissolve
sidebar.viewControllerStore.vc = vc
doc.present(vc, animated: true, completion: nil)
- timer.invalidate()
}
+
+ timer.invalidate()
})
} catch {
print(error.localizedDescription)
