From de73eab760aca4a4f487b3090d838501a13f2a5b Mon Sep 17 00:00:00 2001 From: heliguy4599 Date: Mon, 14 Oct 2024 19:56:47 -0400 Subject: [PATCH] Same as before but better --- src/snapshot_page/snapshot_page.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/snapshot_page/snapshot_page.py b/src/snapshot_page/snapshot_page.py index d26c30f..d75e8cf 100644 --- a/src/snapshot_page/snapshot_page.py +++ b/src/snapshot_page/snapshot_page.py @@ -217,15 +217,16 @@ class SnapshotPage(Adw.BreakpointBin): GLib.idle_add(lambda *_: self.status_stack.set_visible_child(self.split_view)) data_path = f"{HostInfo.home}/.var/app" - total_data = 0 - for folder in os.listdir(data_path): - if folder == "io.github.flattool.Warehouse": + data_exists = False + for package in HostInfo.flatpaks: + if package.info['id'] == "io.io.github.flattool.Warehouse": continue - total_data += 1 - break - - if total_data > 0: + if os.path.exists(package.data_path): + data_exists = True + break + + if data_exists: self.new_button.set_sensitive(True) self.new_button.set_tooltip_text(None) self.status_new_button.set_sensitive(True)