fixed UI bug. Crash on hot plug/unplug Yubikey or similar

fix:Non-constant range: argument must be an integer literal
fix:Generic parameter 'ValueType' shadows generic parameter from outer scope with the same name; this is an error
fix:Converting non-sendable function value to '@Sendable (any FileHandleReader, any FileHandleWriter) async -> Bool' may introduce data races
This commit is contained in:
Dmitrii Taradai
2024-09-09 12:16:20 +03:00
parent 23b3297fee
commit a530a83e87
4 changed files with 14 additions and 9 deletions

View File

@@ -93,14 +93,14 @@ struct ThumbnailPickerView<ValueType: Hashable>: View {
extension ThumbnailPickerView {
struct Item<ValueType: Hashable>: Identifiable {
struct Item<Value: Hashable>: Identifiable {
let id = UUID()
let value: ValueType
let value: Value
let name: LocalizedStringKey
let description: LocalizedStringKey
let thumbnail: AnyView
init<ViewType: View>(value: ValueType, name: LocalizedStringKey, description: LocalizedStringKey, thumbnail: ViewType) {
init<ThumbnailView: View>(value: Value, name: LocalizedStringKey, description: LocalizedStringKey, thumbnail: ThumbnailView) {
self.value = value
self.name = name
self.description = description

View File

@@ -55,7 +55,7 @@ struct StepView: View {
.foregroundColor(.green)
.frame(width: max(0, ((width - (Constants.padding * 2)) / Double(numberOfSteps - 1)) * Double(currentStep) - (Constants.circleWidth / 2)), height: 5)
HStack {
ForEach(0..<numberOfSteps) { index in
ForEach(0..<numberOfSteps, id: \.self) { index in
ZStack {
if currentStep > index {
Circle()