diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 8f2d3cf..f807041 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -1,2 +1,2 @@ -export const DISCORD_SERVER = "https://discord.gg/n9QQ4XhhJP"; +export const DISCORD_SERVER = "n9QQ4XhhJP"; export const GITHUB = "https://github.com/vendetta-mod"; \ No newline at end of file diff --git a/src/lib/metro/common.ts b/src/lib/metro/common.ts index ffcd81f..5130691 100644 --- a/src/lib/metro/common.ts +++ b/src/lib/metro/common.ts @@ -9,6 +9,7 @@ export const toasts = find(m => m.open && m.close && !m.startDrag && !m.init && export const stylesheet = findByProps("createThemedStyleSheet"); export const clipboard = findByProps("setString", "getString", "hasString"); export const assets = findByProps("registerAsset"); +export const invites = findByProps("acceptInviteAndTransitionToInviteChannel"); export const navigation = findByProps("pushLazy"); export const navigationStack = findByProps("createStackNavigator"); export const NavigationNative = findByProps("NavigationContainer"); diff --git a/src/ui/settings/pages/General.tsx b/src/ui/settings/pages/General.tsx index 244ccf0..c8d4baa 100644 --- a/src/ui/settings/pages/General.tsx +++ b/src/ui/settings/pages/General.tsx @@ -1,4 +1,4 @@ -import { ReactNative as RN, url } from "@metro/common"; +import { ReactNative as RN, url, invites } from "@metro/common"; import { DISCORD_SERVER, GITHUB } from "@lib/constants"; import { getAssetIDByName } from "@ui/assets"; import { Forms } from "@ui/components"; @@ -7,7 +7,7 @@ import Version from "@ui/settings/components/Version"; import settings from "@lib/settings"; const { FormRow, FormSwitchRow, FormSection, FormDivider } = Forms; -const debugInfo = getDebugInfo() +const debugInfo = getDebugInfo(); export default function General() { const [devSettings, setDevSettings] = React.useState(settings.developerSettings || false); @@ -73,14 +73,14 @@ export default function General() { } ]; - return ( + return ( } trailing={FormRow.Arrow} - onPress={() => url.openURL(DISCORD_SERVER)} + onPress={() => invites.acceptInviteAndTransitionToInviteChannel({ inviteKey: DISCORD_SERVER })} /> RN.NativeModules.BundleUpdaterManager.reload()} /> - } value={devSettings}