Browse Source

fix: don't create empty tags

Sam Jaffe 3 tuần trước cách đây
mục cha
commit
8a86c752a5
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Todos/View/TagBarView.swift

+ 1 - 1
Todos/View/TagBarView.swift

@@ -37,7 +37,7 @@ struct TagBarView: View {
       .scaledToFit()
       TextField("Tag", text: $active)
         .onSubmit {
-          if !tags.contains(where: { $0.like(active) }) {
+          if !active.isEmpty && !tags.contains(where: { $0.like(active) }) {
             tags.append(Tag(id: active))
           }
           active = ""