This commit is contained in:
JinJiangHuang
2026-03-03 12:28:02 +08:00
parent aebf17dfb5
commit 76ed32ccf3
7 changed files with 568 additions and 149 deletions
+5 -1
View File
@@ -38,7 +38,11 @@ struct HistoryView: View {
.contextMenu {
Button(role: .destructive) {
modelContext.delete(item)
try? modelContext.save()
do {
try modelContext.save()
} catch {
print("删除历史记录失败: \(error)")
}
} label: {
Label("删除记录", systemImage: "trash")
}