diff --git a/src/Modal.tsx b/src/Modal.tsx index b72180097ce..b8dacdbc1e5 100644 --- a/src/Modal.tsx +++ b/src/Modal.tsx @@ -22,9 +22,10 @@ import { IDeferred, defer, sleep } from "matrix-js-sdk/src/utils"; import { TypedEventEmitter } from "matrix-js-sdk/src/matrix"; import { Glass } from "@vector-im/compound-web"; -import dis from "./dispatcher/dispatcher"; +import dis, { defaultDispatcher } from "./dispatcher/dispatcher"; import AsyncWrapper from "./AsyncWrapper"; import { Defaultize } from "./@types/common"; +import { ActionPayload } from "./dispatcher/payloads"; const DIALOG_CONTAINER_ID = "mx_Dialog_Container"; const STATIC_DIALOG_CONTAINER_ID = "mx_Dialog_StaticContainer"; @@ -114,6 +115,21 @@ export class ModalManager extends TypedEventEmitter { + if (payload.action === "logout") { + this.forceCloseAllModals(); + } + }; + public toggleCurrentDialogVisibility(): void { const modal = this.getCurrentModal(); if (!modal) return;