mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 01:15:28 +00:00
feat: re-work modal behaviour to be more natural
This commit is contained in:
@@ -13,6 +13,8 @@ import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice";
|
||||
|
||||
import { useApplicationState } from "../../mobx/State";
|
||||
|
||||
import { modalController } from "../../context/modals";
|
||||
|
||||
import ButtonItem from "../../components/navigation/items/ButtonItem";
|
||||
|
||||
interface Props {
|
||||
@@ -61,6 +63,8 @@ export function GenericSettings({
|
||||
useEffect(() => {
|
||||
function keyDown(e: KeyboardEvent) {
|
||||
if (e.key === "Escape") {
|
||||
if (modalController.isVisible) return;
|
||||
|
||||
exitSettings();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user