Close all active modals when home shortcut is used
Signed-off-by: Heiko Carrasco <heiko.carrasco@yahoo.com>pull/21833/head
parent
f36651f538
commit
d7f15985f5
|
@ -147,6 +147,15 @@ export class ModalManager {
|
||||||
return this.appendDialogAsync<T>(...rest);
|
return this.appendDialogAsync<T>(...rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public closeCurrentModal(reason: string) {
|
||||||
|
const modal = this.getCurrentModal();
|
||||||
|
if (!modal) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
modal.closeReason = reason;
|
||||||
|
modal.close();
|
||||||
|
}
|
||||||
|
|
||||||
private buildModal<T extends any[]>(
|
private buildModal<T extends any[]>(
|
||||||
prom: Promise<React.ComponentType>,
|
prom: Promise<React.ComponentType>,
|
||||||
props?: IProps<T>,
|
props?: IProps<T>,
|
||||||
|
|
|
@ -52,6 +52,7 @@ import RoomListStore from "../../stores/room-list/RoomListStore";
|
||||||
import NonUrgentToastContainer from "./NonUrgentToastContainer";
|
import NonUrgentToastContainer from "./NonUrgentToastContainer";
|
||||||
import { ToggleRightPanelPayload } from "../../dispatcher/payloads/ToggleRightPanelPayload";
|
import { ToggleRightPanelPayload } from "../../dispatcher/payloads/ToggleRightPanelPayload";
|
||||||
import { IThreepidInvite } from "../../stores/ThreepidInviteStore";
|
import { IThreepidInvite } from "../../stores/ThreepidInviteStore";
|
||||||
|
import Modal from "../../Modal";
|
||||||
|
|
||||||
// We need to fetch each pinned message individually (if we don't already have it)
|
// We need to fetch each pinned message individually (if we don't already have it)
|
||||||
// so each pinned message may trigger a request. Limit the number per room for sanity.
|
// so each pinned message may trigger a request. Limit the number per room for sanity.
|
||||||
|
@ -450,6 +451,7 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'view_home_page',
|
action: 'view_home_page',
|
||||||
});
|
});
|
||||||
|
Modal.closeCurrentModal("homeKeyboardShortcut");
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue