1
0
Fork 0

Make back gesture close modals and similar

This commit is contained in:
Vendicated 2022-11-25 13:05:02 +01:00
parent 924ba2b74b
commit 2f35908d0c
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3
5 changed files with 58 additions and 9 deletions

View file

@ -0,0 +1,12 @@
!(() => {
const ModalEscapeHandler = Vencord.Util.lazyWebpack(m => m.binds?.[0] === "esc" && m.binds.length === 1);
const EscapeHandler = Vencord.Util.lazyWebpack(m => m.binds?.[0] === "esc" && m.binds[1] === "shift+pagedown");
window.VencordMobile = {
onBackPress() {
// false implies modal closed
if (ModalEscapeHandler.action() === false) return;
EscapeHandler.action({target:document.activeElement});
}
}
})();