Add tag command

This commit is contained in:
Christoph Hagen
2024-12-14 19:02:01 +01:00
parent cdaaa36303
commit 657f8c4ef4
8 changed files with 77 additions and 14 deletions

View File

@ -248,7 +248,7 @@ struct PageIssueView: View {
return
}
let tag = Tag(id: tagId)
let tag = Tag(content: content, id: tagId)
content.tags.append(tag)
retryPageCheck()

View File

@ -24,9 +24,11 @@ struct AddTagView: View {
}
private func addNewTag() {
let newTag = Tag(isVisible: true,
german: .init(urlComponent: "tag", name: "Neuer Tag"),
english: .init(urlComponent: "tag-en", name: "New Tag"))
let newTag = Tag(
content: content,
isVisible: true,
german: .init(urlComponent: "tag", name: "Neuer Tag"),
english: .init(urlComponent: "tag-en", name: "New Tag"))
// Add to top of the list, and resort when changing the name
content.tags.insert(newTag, at: 0)
dismiss()