Skip to content

Commit

Permalink
Add fallback for ActionSheet finding
Browse files Browse the repository at this point in the history
  • Loading branch information
FieryFlames committed Jan 28, 2023
1 parent ea4764a commit b7e0bf6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/sheets/AddToServerActionSheet.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { find, findByProps } from "@vendetta/metro";
import { find, findByProps, findByDisplayName } from "@vendetta/metro";
import { Permissions } from "@vendetta/metro/common/constants";
import { FormDivider } from "@vendetta/ui/components/Forms";
import AddToServerRow from "../components/AddToServerRow";

const LazyActionSheet = findByProps("openLazy", "hideActionSheet");

// Components
const ActionSheet = find((m) => m.default && m.default.render && m.default.render.name == "ActionSheet").default.render;
let ActionSheet;
try {
ActionSheet = find((m) => m.default && m.default.render && m.default.render.name == "ActionSheet").default.render;
} catch {
ActionSheet = findByDisplayName("SimpleActionSheet")({ options: [] }).type.render;
}
const { BottomSheetScrollView } = findByProps("BottomSheetScrollView");

// Stores
Expand Down

0 comments on commit b7e0bf6

Please sign in to comment.