Skip to content

Commit

Permalink
Fix ability to edit Synced device name (#3404)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1201493110486074/1208413262127358/f
Tech Design URL:
CC:

Description:
Fixes bug which caused the edit synced device name & remove synced devices screens to dismiss as soon as they were presented due to multiple spurious presentation attempts firing
  • Loading branch information
amddg44 authored Oct 4, 2024
1 parent ef260b9 commit 477ec85
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 16 additions & 0 deletions LocalPackages/SyncUI/Sources/SyncUI/Views/SyncSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,22 @@ public struct SyncSettingsView: View {
})
)
}
.sheet(item: $selectedDevice) { device in
Group {
if device.isThisDevice {
EditDeviceView(model: model.createEditDeviceModel(device))
} else {
RemoveDeviceView(model: model.createRemoveDeviceModel(device))
}
}
.modifier {
if #available(iOS 16.0, *) {
$0.presentationDetents([.medium])
} else {
$0
}
}
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,22 +195,6 @@ extension SyncSettingsView {
} header: {
Text(UserText.syncedDevicesSectionHeader)
}
.sheet(item: $selectedDevice) { device in
Group {
if device.isThisDevice {
EditDeviceView(model: model.createEditDeviceModel(device))
} else {
RemoveDeviceView(model: model.createRemoveDeviceModel(device))
}
}
.modifier {
if #available(iOS 16.0, *) {
$0.presentationDetents([.medium])
} else {
$0
}
}
}
.onReceive(timer) { _ in
if selectedDevice == nil {
model.delegate?.refreshDevices(clearDevices: false)
Expand Down

0 comments on commit 477ec85

Please sign in to comment.