소스 검색

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)
     }
   }