Skip to content

Commit

Permalink
add new config key
Browse files Browse the repository at this point in the history
  • Loading branch information
SynthesOne committed Aug 22, 2024
1 parent 6e3e1c0 commit d1b619a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Sources/General/MPPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,14 @@ public final class MPPresenter: NSObject {
}

private func showNoAuthAlert() {
let alert = Alert(message: Lang.notAuthPhotos, {
Action.cancel(Lang.ok)
let alert = Alert(message: Lang.notAuthPhotos, { [weak self] in
if self?.config.uiConfig.showOpenSettingsButton == true {
Action.default(Lang.changeSettings, action: {
guard let url = URL(string: UIApplication.openSettingsURLString) else { return }
UIApplication.shared.open(url, options: [:])
})
}
Action.cancel(Lang.cancel)
})

if isIpad {
Expand Down
4 changes: 4 additions & 0 deletions Sources/General/MPUIConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public struct MPUIConfiguration {
MPFontDeploy.nameSpace = customFontName
}
}

/// If access is denied to Photo
/// Determines whether to show a button to open settings
public var showOpenSettingsButton = true
}

enum MPFontDeploy {
Expand Down

0 comments on commit d1b619a

Please sign in to comment.