Fix import undo logic

This commit is contained in:
kramo
2023-08-15 21:46:58 +02:00
parent b466eb7ab2
commit cb9513ff13
2 changed files with 4 additions and 1 deletions

View File

@@ -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: