Skip to content

Commit

Permalink
Fix where dialog don't have restrictDismissal configuration (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
jevonmao authored Sep 3, 2021
1 parent 2f3c429 commit 91c7534
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ public class PermissionSchemaStore: ObservableObject {
if configStore.restrictDismissal ||
((permissionViewStyle == .modal && store.restrictModalDismissal) ||
(permissionViewStyle == .alert && store.restrictAlertDismissal)) {
//Empty means all permissions interacted, so should no longer stay in presentation
// number of interacted permissions equal to number
// of all permissions means means everything has been
// interacted with, thus if so, shouldStayInPresentation
// will be false and dismissal is allowed
return !(interactedPermissions.count == permissions.count)
}
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,15 @@ public extension View {

*/

func JMAlert(showModal: Binding<Bool>, for permissions: [PermissionType.PermissionManager], autoDismiss: Bool?=nil, autoCheckAuthorization: Bool?=nil) -> some CustomizableView {
initializeJMAlert(showModal: showModal, for: permissions, autoDismiss: autoDismiss, autoCheckAuthorization: autoCheckAuthorization)
func JMAlert(showModal: Binding<Bool>, for permissions: [PermissionType.PermissionManager],
restrictDismissal: Bool?=nil,
autoDismiss: Bool?=nil,
autoCheckAuthorization: Bool?=nil) -> some CustomizableView {
initializeJMAlert(showModal: showModal,
for: permissions,
autoDismiss: autoDismiss,
autoCheckAuthorization: autoCheckAuthorization,
restrictDismissal: restrictDismissal)
}

/**
Expand Down

0 comments on commit 91c7534

Please sign in to comment.