fix: store tag.id to variable before using in lambda

This fixes an issue where every tag added from the "+" button had ID 0 (the "Archived" tag).

Co-Authored-By: Jann Stute <46534683+Computerdores@users.noreply.github.com>
This commit is contained in:
Travis Abendshien
2025-01-13 14:42:19 -08:00
parent 5c8f2c507f
commit 604837fcaa

View File

@@ -112,7 +112,8 @@ class TagSearchPanel(PanelWidget):
f"background: {get_tag_color(ColorType.LIGHT_ACCENT, tag.color)};"
f"}}"
)
add_button.clicked.connect(lambda x=tag.id: self.tag_chosen.emit(x))
tag_id = tag.id
add_button.clicked.connect(lambda: self.tag_chosen.emit(tag_id))
row.addWidget(add_button)
return container