Skip to content

Commit

Permalink
[Fix/#95] 취소 눌렀을 때
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe0929 committed Jan 19, 2024
1 parent f2d9fca commit f90be48
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,20 @@ struct AppAddButtonView: View {
.familyActivityPicker(isPresented: $isPresented, selection: $model.newSelection)
.onChange(of: isPresented) { oldValue, newValue in
if newValue == false {
ScreenTime.shared.selectedApps = model.newSelection
shieldedApps = model.newSelection
ScreenTime.shared.saveHashValue()

let mainViewController = TabBarController()
let navigationController = UINavigationController(rootViewController: mainViewController)
let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate
guard let delegate = sceneDelegate else {
return
if !model.newSelection.applicationTokens.isEmpty {
ScreenTime.shared.selectedApps = model.newSelection
shieldedApps = model.newSelection
ScreenTime.shared.saveHashValue()

let mainViewController = TabBarController()
let navigationController = UINavigationController(rootViewController: mainViewController)
let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate
guard let delegate = sceneDelegate else {
return
}
delegate.window?.rootViewController = navigationController
navigationController.pushViewController(GoalTimeSelectViewController(), animated: true)
}
delegate.window?.rootViewController = navigationController
navigationController.pushViewController(GoalTimeSelectViewController(), animated: true)
}
}

Expand Down

0 comments on commit f90be48

Please sign in to comment.