|
@@ -20,10 +20,6 @@ struct NewProjectMenu: View {
|
|
|
private func addItem() {
|
|
private func addItem() {
|
|
|
withAnimation {
|
|
withAnimation {
|
|
|
let newItem = Project(timestamp: Date())
|
|
let newItem = Project(timestamp: Date())
|
|
|
- let count = items.count(where: { $0.name.starts(with: "New Project") })
|
|
|
|
|
- if (count > 0) {
|
|
|
|
|
- newItem.name += " (\(count))"
|
|
|
|
|
- }
|
|
|
|
|
modelContext.insert(newItem)
|
|
modelContext.insert(newItem)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|