fix(gui): show empty

Dispaly empty table if nothing was found
This commit is contained in:
Kristofers Solo 2023-11-08 15:57:14 +02:00
parent 4843f74dff
commit b189e49fb9

View File

@ -86,7 +86,6 @@ class App(ctk.CTk):
authors = self.inventory.find_by_author(value) authors = self.inventory.find_by_author(value)
if authors: if authors:
data += authors data += authors
self.refresh(data) self.refresh(data)
# Bind the search function to the <Enter> key press # Bind the search function to the <Enter> key press
@ -199,7 +198,8 @@ class App(ctk.CTk):
def refresh(self, data=None) -> None: def refresh(self, data=None) -> None:
"""Update the table with new data or reset it.""" """Update the table with new data or reset it."""
self.clear_table() self.clear_table()
self.data = data if data else self.inventory.list_all() self.data = data if data is not None else self.inventory.list_all()
logger.debug(self.data)
self.display() self.display()
@logger.catch @logger.catch