From faa90eccd363b635b84be2162376645d6a83ad55 Mon Sep 17 00:00:00 2001
From: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Date: Wed, 1 Mar 2023 01:26:13 -0300
Subject: feat: Crash Handler (#531)

Co-authored-by: Ven <vendicated@riseup.net>
---
 src/utils/modal.tsx | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'src/utils/modal.tsx')

diff --git a/src/utils/modal.tsx b/src/utils/modal.tsx
index 3174cac..35aaaf8 100644
--- a/src/utils/modal.tsx
+++ b/src/utils/modal.tsx
@@ -117,6 +117,7 @@ const ModalAPI = mapMangledModuleLazy("onCloseRequest:null!=", {
     openModal: filters.byCode("onCloseRequest:null!="),
     closeModal: filters.byCode("onCloseCallback&&"),
     openModalLazy: m => m?.length === 1 && filters.byCode(".apply(this,arguments)")(m),
+    closeAllModals: filters.byCode(".value.key,")
 });
 
 /**
@@ -142,3 +143,10 @@ export function openModal(render: RenderFunction, options?: ModalOptions, contex
 export function closeModal(modalKey: string, contextKey?: string): void {
     return ModalAPI.closeModal(modalKey, contextKey);
 }
+
+/**
+ * Close all open modals
+ */
+export function closeAllModals(): void {
+    return ModalAPI.closeAllModals();
+}
-- 
cgit 

