Merge pull request #60 from Thesacraft/main

Fixes issue with badges not getting updated if meta tags gets removed
This commit is contained in:
Travis Abendshien 2024-04-26 13:36:57 -07:00 committed by GitHub
commit 039c574cf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2673,8 +2673,13 @@ class PreviewPanel(QWidget):
entry = self.lib.get_entry(item_pair[1])
try:
index = entry.fields.index(field)
updated_badges = False
if 8 in entry.fields[index].keys() and (1 in entry.fields[index][8] or 0 in entry.fields[index][8]):
updated_badges = True
# TODO: Create a proper Library/Entry method to manage fields.
entry.fields.pop(index)
if updated_badges:
self.driver.update_badges()
except ValueError:
logging.info(f'[PREVIEW PANEL][ERROR?] Tried to remove field from Entry ({entry.id}) that never had it')
pass