mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-07 11:19:58 +02:00
fix(apple): make the device detail screen reachable
The Settings stack has a typed path of [SettingsSection], so a NavigationLink carrying a String could never push onto it: tapping a device in the list did nothing. Contact detail is now a SettingsSection case, and the path maps it to the two-level push the way the bug report screen already does.
This commit is contained in:
@@ -15,6 +15,8 @@ struct SettingsScreen: View {
|
||||
switch model.state.selectedSection {
|
||||
case .overview: return []
|
||||
case .bugReport: return [.about, .bugReport]
|
||||
case .contactDetail(let endpointId):
|
||||
return [.contacts, .contactDetail(endpointId: endpointId)]
|
||||
case let section: return [section]
|
||||
}
|
||||
},
|
||||
@@ -92,7 +94,9 @@ struct SettingsScreen: View {
|
||||
private func sectionForm(_ section: SettingsSection) -> some View {
|
||||
// Contacts brings its own Form and push destination, so it is not wrapped
|
||||
// in the shared section chrome.
|
||||
if section == .contacts {
|
||||
if case .contactDetail(let endpointId) = section {
|
||||
ContactDetailScreen(model: contacts, endpointId: endpointId)
|
||||
} else if section == .contacts {
|
||||
ContactsScreen(model: contacts) {
|
||||
model.reportNothingWaiting()
|
||||
}
|
||||
@@ -153,7 +157,7 @@ private struct SettingsSectionContent: View {
|
||||
NetworkSettings(model: model)
|
||||
case .storage:
|
||||
StorageSettings(model: model)
|
||||
case .contacts:
|
||||
case .contacts, .contactDetail:
|
||||
// Rendered by SettingsScreen itself, which owns the contacts model.
|
||||
EmptyView()
|
||||
case .about:
|
||||
|
||||
Reference in New Issue
Block a user