Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

fix exception at exit #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion iroha_tui/app/screen_manager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from asciimatics.exceptions import StopApplication
from asciimatics.scene import Scene
from loguru import logger

Expand Down Expand Up @@ -101,10 +102,14 @@ def back(self):
Asciimatics transition to a previous scene popping the stack.
"""
self._scene.remove_effect(self._scene.effects[-1])
while getattr(self._scene.effects[-1], "is_skippable", False):
while self._scene.effects and getattr(self._scene.effects[-1],
"is_skippable", False):
self._scene.remove_effect(self._scene.effects[-1])
self._screen.clear()
self._scene.reset()
if not self._scene.effects:
self._scene.exit()
raise StopApplication("Exit from the initial scene.")
logger.debug(f"Transition back, screen stack {str(self)}")

def __str__(self):
Expand Down