Fix import undo logic
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user