fix bug
This commit is contained in:
@@ -289,6 +289,7 @@ struct ContentView: View {
|
||||
.clipShape(Capsule())
|
||||
.shadow(color: .red.opacity(0.4), radius: 12, x: 0, y: 6)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.disabled(
|
||||
settingsVM.isLoadingConfig
|
||||
|| settingsVM.vodApiUrl.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
|
||||
|
||||
@@ -38,7 +38,11 @@ struct FavoritesView: View {
|
||||
.contextMenu {
|
||||
Button(role: .destructive) {
|
||||
modelContext.delete(item)
|
||||
try? modelContext.save()
|
||||
do {
|
||||
try modelContext.save()
|
||||
} catch {
|
||||
print("删除收藏失败: \(error)")
|
||||
}
|
||||
} label: {
|
||||
Label("取消收藏", systemImage: "heart.slash")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user