From 06d181447cd0c9dfe5e93b60b95eb4c433c2e88a Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Tue, 2 Feb 2021 09:40:09 +0100 Subject: [PATCH] Remove screens before returning their result --- src/widgets/new_navigator.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/new_navigator.rs b/src/widgets/new_navigator.rs index 33b360f..49ca513 100644 --- a/src/widgets/new_navigator.rs +++ b/src/widgets/new_navigator.rs @@ -69,14 +69,14 @@ impl NavigationHandle { /// Go back to the previous screen optionally returning something. pub fn pop(&self, output: Option) { + self.unwrap_navigator().pop(); + let sender = self.sender.take() .expect("Tried to send result from screen through a dropped sender."); if sender.send(output).is_err() { panic!("Tried to send result from screen to non-existing previous screen."); } - - self.unwrap_navigator().pop(); } /// Get the navigator and panic if it doesn't exist.