Disable start button if profiles is empty on macOS
This commit is contained in:
@@ -120,8 +120,10 @@ public struct ActiveDashboardView: View {
|
||||
|
||||
} catch {
|
||||
alert = Alert(error)
|
||||
return
|
||||
}
|
||||
}
|
||||
environments.emptyProfiles = profileList.isEmpty
|
||||
}
|
||||
|
||||
private nonisolated func doReloadSystemProxy() async {
|
||||
|
||||
@@ -36,6 +36,7 @@ public struct StartStopButton: View {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
.disabled(environments.emptyProfiles)
|
||||
}
|
||||
|
||||
private struct Button0: View {
|
||||
|
||||
@@ -207,6 +207,7 @@ public struct ProfileView: View {
|
||||
return
|
||||
}
|
||||
}
|
||||
environments.emptyProfiles = profileList.isEmpty
|
||||
}
|
||||
|
||||
private func updateProfile(_ profile: Profile) async {
|
||||
@@ -254,6 +255,7 @@ public struct ProfileView: View {
|
||||
profileList[index].origin
|
||||
}
|
||||
profileList.remove(atOffsets: profileIndex)
|
||||
environments.emptyProfiles = profileList.isEmpty
|
||||
Task {
|
||||
do {
|
||||
_ = try await ProfileManager.delete(profileToDelete)
|
||||
|
||||
Reference in New Issue
Block a user