Fix closing all modals (#12728)
* Fix closing all modals We used `Modal.closeCurrentModal()` in a bunch of places, in all cases (as far as I can see: it wasn't commented) we meant to close all open modals. This swaps that function for one that closes all open modals. Also types the close reason which claimed to be something in a comment, of course, was wrong because a load of places passed their own random string which was never used. * Force close modals * Try with minimal changes * Already had a method for this * Add test * More tests * Unused importsd
This commit is contained in:
parent
a7542dc0ac
commit
dcf7643d4a
8 changed files with 95 additions and 17 deletions
|
@ -488,11 +488,15 @@ class LoggedInView extends React.Component<IProps, IState> {
|
|||
handled = true;
|
||||
break;
|
||||
case KeyBindingAction.GoToHome:
|
||||
// even if we cancel because there are modals open, we still
|
||||
// handled it: nothing else should happen.
|
||||
handled = true;
|
||||
if (Modal.hasDialogs()) {
|
||||
return;
|
||||
}
|
||||
dis.dispatch({
|
||||
action: Action.ViewHomePage,
|
||||
});
|
||||
Modal.closeCurrentModal("homeKeyboardShortcut");
|
||||
handled = true;
|
||||
break;
|
||||
case KeyBindingAction.ToggleSpacePanel:
|
||||
dis.fire(Action.ToggleSpacePanel);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue