Skip to content

Commit

Permalink
Fixed denied alert logic for dialog style.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvorobei committed Jun 15, 2021
1 parent 3c29297 commit 9df0dd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Binary file not shown.
Expand Up @@ -155,6 +155,7 @@ public class SPPermissionsDialogController: UIViewController, SPPermissionsContr

@objc func process(button: SPPermissionsActionButton) {
guard let permission = button.permission else { return }
let firstRequest = permission.status == .notDetermined
permission.request { [weak self] in

guard let self = self else { return }
Expand Down Expand Up @@ -191,12 +192,15 @@ public class SPPermissionsDialogController: UIViewController, SPPermissionsContr
} else {
self.delegate?.didDeniedPermission(permission)

// Delay using for fix animation freeze.
if !firstRequest {

// Delay using for fix animation freeze.
Delay.wait(0.3, closure: { [weak self] in
guard let self = self else { return }
Presenter.presentAlertAboutDeniedPermission(permission, dataSource: self.dataSource, on: self)
})
}

Delay.wait(0.3, closure: { [weak self] in
guard let self = self else { return }
Presenter.presentAlertAboutDeniedPermission(permission, dataSource: self.dataSource, on: self)
})
}
}
}
Expand Down

0 comments on commit 9df0dd6

Please sign in to comment.