iOS 0.4.1: clearing tiles, deleting presets and slot-editor imports work on iOS 15

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-11-16 09:40:32 +01:00
co-authored by Claude Opus 5.5
parent 962cfd1e2b
commit 42f66534bf
4 changed files with 32 additions and 25 deletions
@@ -70,16 +70,14 @@ private struct ToolboxBody: View {
}
}
.background(Theme.background)
.alert("Clear tile", isPresented: Binding(get: { clearing != nil }, set: { if !$0 { clearing = nil } }), actions: {
Button("Clear", role: .destructive) {
if let i = clearing { session.clearSlot(i) }
clearing = nil
}
Button("Cancel", role: .cancel) { clearing = nil }
}, message: {
if let i = clearing {
Text("Remove \"\(tileLabel(i))\" from tile \(i + 1)? This clears the device and its settings and can't be undone.")
}
// `presenting:` hands the tile to the buttons: SwiftUI resets the binding
// (and so `clearing`) before a button's action runs.
.alert("Clear tile", isPresented: Binding(get: { clearing != nil }, set: { if !$0 { clearing = nil } }),
presenting: clearing, actions: { i in
Button("Clear", role: .destructive) { session.clearSlot(i) }
Button("Cancel", role: .cancel) {}
}, message: { i in
Text("Remove \"\(tileLabel(i))\" from tile \(i + 1)? This clears the device and its settings and can't be undone.")
})
}