Skip to content

Commit 8787b2a

Browse files
committed
Make sure the permissions controller is displayed if the camera permissions are not determined. #141
1 parent 11183c1 commit 8787b2a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Sources/Gallery/GalleryController.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,15 @@ public class GalleryController: UIViewController, PermissionControllerDelegate {
6969

7070
func makePagesController() -> PagesController? {
7171
guard Permission.Photos.status == .authorized else {
72-
return nil
72+
return nil
7373
}
74-
74+
7575
let useCamera = Permission.Camera.needsPermission && Permission.Camera.status == .authorized
76-
76+
7777
let tabsToShow = Config.tabsToShow.compactMap { $0 != .cameraTab ? $0 : (useCamera ? $0 : nil) }
78+
if useCamera, Permission.Camera.status == .notDetermined {
79+
return nil
80+
}
7881

7982
let controllers: [UIViewController] = tabsToShow.compactMap { tab in
8083
if tab == .imageTab {

0 commit comments

Comments
 (0)