diff --git a/src/store/store.py b/src/store/store.py index 89c7f11..a11bf5a 100644 --- a/src/store/store.py +++ b/src/store/store.py @@ -103,6 +103,7 @@ class Store: for undo in ("remove", "hide"): try: shared.win.toasts[(game, undo)].dismiss() + shared.win.toasts.pop((game, undo)) except KeyError: pass diff --git a/src/window.py b/src/window.py index 37bad99..ac2ab42 100644 --- a/src/window.py +++ b/src/window.py @@ -331,7 +331,9 @@ class CartridgesWindow(Adw.ApplicationWindow): def on_undo_action(self, _widget, game=None, undo=None): if not game: # If the action was activated via Ctrl + Z - if shared.importer.imported_game_ids or shared.importer.removed_game_ids: + if shared.importer and ( + shared.importer.imported_game_ids or shared.importer.removed_game_ids + ): undo = "import" else: try: