spb/focale Public
Swift 100%
1//2// RootView.swift3// Focale4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7//89import SwiftUI1011struct RootView: View {12 @Environment(AppModel.self) private var app1314 var body: some View {15 Group {16 if app.hasFullPhotoAccess {17 mainTabs18 } else if app.hasLimitedPhotoAccess {19 LimitedAccessView()20 } else {21 OnboardingView()22 }23 }24 .onAppear { app.refreshPhotoAccess() }25 }2627 private var mainTabs: some View {28 TabView {29 Tab("Appareil", systemImage: "camera.fill") {30 CaptureView()31 }32 Tab("Bibliothèque", systemImage: "photo.on.rectangle") {33 LibraryView()34 }35 Tab("Recherche", systemImage: "magnifyingglass") {36 SearchView()37 }38 }39 .task(priority: .utility) {40 // Recent photos become searchable right away; the deep41 // backfill still runs at night on the charger.42 await app.indexPipeline.indexRecentInForeground()43 }44 }45}46