Fix import undo logic
This commit is contained in:
@@ -103,6 +103,7 @@ class Store:
|
|||||||
for undo in ("remove", "hide"):
|
for undo in ("remove", "hide"):
|
||||||
try:
|
try:
|
||||||
shared.win.toasts[(game, undo)].dismiss()
|
shared.win.toasts[(game, undo)].dismiss()
|
||||||
|
shared.win.toasts.pop((game, undo))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -331,7 +331,9 @@ class CartridgesWindow(Adw.ApplicationWindow):
|
|||||||
|
|
||||||
def on_undo_action(self, _widget, game=None, undo=None):
|
def on_undo_action(self, _widget, game=None, undo=None):
|
||||||
if not game: # If the action was activated via Ctrl + Z
|
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"
|
undo = "import"
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user