mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
Remove screens before returning their result
This commit is contained in:
parent
486dbd7cbb
commit
06d181447c
1 changed files with 2 additions and 2 deletions
|
|
@ -69,14 +69,14 @@ impl<O> NavigationHandle<O> {
|
|||
|
||||
/// Go back to the previous screen optionally returning something.
|
||||
pub fn pop(&self, output: Option<O>) {
|
||||
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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue