Skip to content

Commit

Permalink
fix UX state after button press on dynamic modal
Browse files Browse the repository at this point in the history
This bug was hidden by the previous return of state before
the reliquish.

Now with the correct ordering, we end up getting a double-relinquish
which ends up trying to swap a modal into focus which doesn't exist.

This fixes that edge case
  • Loading branch information
bunnie committed Nov 8, 2022
1 parent 4c45dfa commit 11a0107
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions services/gam/src/modal/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ impl ActionApi for Notification {
}
_ => {
// relinquish focus before returning the result
self.gam.relinquish_focus().unwrap();
xous::yield_slice();
if self.manual_dismiss {
self.gam.relinquish_focus().unwrap();
xous::yield_slice();
}

send_message(
self.action_conn,
Expand Down

0 comments on commit 11a0107

Please sign in to comment.