diff --git a/plugins/action-sheet-finder/src/index.tsx b/plugins/action-sheet-finder/src/index.tsx index 28e31a7..301ab19 100644 --- a/plugins/action-sheet-finder/src/index.tsx +++ b/plugins/action-sheet-finder/src/index.tsx @@ -4,21 +4,20 @@ import { getAssetIDByName } from '@vendetta/ui/assets'; import { findByProps } from "@vendetta/metro"; const LazyActionSheet = findByProps("openLazy", "hideActionSheet"); -let unpatchOpenLazy: () => boolean; function SheetOutput(text) { console.log("[ActionSheetFinder] Found ActionSheet: " + text); showToast("[ActionSheetFinder] Found ActionSheet: " + text, getAssetIDByName("Check")) } +const unpatchOpenLazy = before("openLazy", LazyActionSheet, ([_, key]) => { + // console.log(this) + return SheetOutput(key); +}); export default { - onLoad() { + onLoad: () => { console.log("[ActionSheetFinder] Hello world!") - unpatchOpenLazy = before('openLazy', LazyActionSheet, ([key]) => { - console.log(this) - return SheetOutput(key); - }); }, - onUnload: unpatchOpenLazy + onUnload: () => {unpatchOpenLazy()} }; \ No newline at end of file