Skip to content

Commit b28e393

Browse files
committed
fix(AppRouter): Prevent app restoration if Drive are not matching
1 parent 727ea06 commit b28e393

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kDrive/AppRouter.swift

+6
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ public struct AppRouter: AppNavigable {
190190
return
191191
}
192192

193+
guard let previousDriveId = sceneUserInfo[SceneRestorationValues.driveId.rawValue] as? Int,
194+
previousDriveId == driveFileManager.drive.id else {
195+
Log.sceneDelegate("driveId do not match for restore :\(sceneUserInfo)", level: .error)
196+
return
197+
}
198+
193199
let selectedIndex = tabBarViewController.selectedIndex
194200
let viewControllers = tabBarViewController.viewControllers
195201
guard let rootNavigationController = viewControllers?[safe: selectedIndex] as? UINavigationController else {

0 commit comments

Comments
 (0)