Преглед на файлове

refactor: don't add trailing number

Sam Jaffe преди 2 седмици
родител
ревизия
873dccc138
променени са 2 файла, в които са добавени 0 реда и са изтрити 8 реда
  1. 0 4
      Todos/View/ContentView.swift
  2. 0 4
      Todos/View/Menu/NewProjectMenu.swift

+ 0 - 4
Todos/View/ContentView.swift

@@ -52,10 +52,6 @@ struct ContentView: View {
   private func addItem() {
     withAnimation {
       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)
     }
   }

+ 0 - 4
Todos/View/Menu/NewProjectMenu.swift

@@ -20,10 +20,6 @@ struct NewProjectMenu: View {
   private func addItem() {
     withAnimation {
       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)
     }
   }