Skip permission validation after onboarding and display dashboard directly to all users
This commit is contained in:
parent
a69f0239b1
commit
45fd4c327b
@ -172,18 +172,8 @@ struct ContentView: View {
|
||||
@AppStorage("powerModeUIFlag") private var powerModeUIFlag = false
|
||||
@State private var selectedView: ViewType = .metrics
|
||||
@State private var hoveredView: ViewType?
|
||||
@State private var hasLoadedData = false
|
||||
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "1.0.0"
|
||||
@StateObject private var licenseViewModel = LicenseViewModel()
|
||||
|
||||
|
||||
private var isSetupComplete: Bool {
|
||||
hasLoadedData &&
|
||||
whisperState.currentTranscriptionModel != nil &&
|
||||
hotkeyManager.selectedHotkey1 != .none &&
|
||||
AXIsProcessTrusted() &&
|
||||
CGPreflightScreenCaptureAccess()
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
NavigationSplitView {
|
||||
@ -201,9 +191,6 @@ struct ContentView: View {
|
||||
}
|
||||
.navigationSplitViewStyle(.balanced)
|
||||
.frame(minWidth: 940, minHeight: 730)
|
||||
.onAppear {
|
||||
hasLoadedData = true
|
||||
}
|
||||
// inside ContentView body:
|
||||
.onReceive(NotificationCenter.default.publisher(for: .navigateToDestination)) { notification in
|
||||
if let destination = notification.userInfo?["destination"] as? String {
|
||||
@ -235,12 +222,7 @@ struct ContentView: View {
|
||||
private var detailView: some View {
|
||||
switch selectedView {
|
||||
case .metrics:
|
||||
if isSetupComplete {
|
||||
MetricsView(skipSetupCheck: true)
|
||||
} else {
|
||||
MetricsSetupView()
|
||||
.environmentObject(hotkeyManager)
|
||||
}
|
||||
MetricsView()
|
||||
case .models:
|
||||
ModelManagementView(whisperState: whisperState)
|
||||
case .enhancement:
|
||||
|
||||
@ -9,12 +9,6 @@ struct MetricsView: View {
|
||||
@EnvironmentObject private var whisperState: WhisperState
|
||||
@EnvironmentObject private var hotkeyManager: HotkeyManager
|
||||
@StateObject private var licenseViewModel = LicenseViewModel()
|
||||
@State private var hasLoadedData = false
|
||||
let skipSetupCheck: Bool
|
||||
|
||||
init(skipSetupCheck: Bool = false) {
|
||||
self.skipSetupCheck = skipSetupCheck
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
@ -48,35 +42,12 @@ struct MetricsView: View {
|
||||
)
|
||||
.padding()
|
||||
}
|
||||
|
||||
Group {
|
||||
if skipSetupCheck {
|
||||
MetricsContent(
|
||||
transcriptions: Array(transcriptions),
|
||||
licenseState: licenseViewModel.licenseState
|
||||
)
|
||||
} else if isSetupComplete {
|
||||
MetricsContent(
|
||||
transcriptions: Array(transcriptions),
|
||||
licenseState: licenseViewModel.licenseState
|
||||
)
|
||||
} else {
|
||||
MetricsSetupView()
|
||||
}
|
||||
}
|
||||
|
||||
MetricsContent(
|
||||
transcriptions: Array(transcriptions),
|
||||
licenseState: licenseViewModel.licenseState
|
||||
)
|
||||
}
|
||||
.background(Color(.controlBackgroundColor))
|
||||
.task {
|
||||
// Ensure the model context is ready
|
||||
hasLoadedData = true
|
||||
}
|
||||
}
|
||||
|
||||
private var isSetupComplete: Bool {
|
||||
hasLoadedData &&
|
||||
whisperState.currentTranscriptionModel != nil &&
|
||||
hotkeyManager.selectedHotkey1 != .none &&
|
||||
AXIsProcessTrusted() &&
|
||||
CGPreflightScreenCaptureAccess()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user