[Settings > General] Accept discord server invite in-app (#4)
* [Settings > General] Make Discord Server button accept invite in-app * [Settings > General] My changes Co-authored-by: Beef <beefers@riseup.net>
This commit is contained in:
parent
71f687e345
commit
da83d4756a
3 changed files with 7 additions and 6 deletions
|
@ -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";
|
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
@ -80,7 +80,7 @@ export default function General() {
|
|||
label="Discord Server"
|
||||
leading={<FormRow.Icon source={getAssetIDByName("Discord")} />}
|
||||
trailing={FormRow.Arrow}
|
||||
onPress={() => url.openURL(DISCORD_SERVER)}
|
||||
onPress={() => invites.acceptInviteAndTransitionToInviteChannel({ inviteKey: DISCORD_SERVER })}
|
||||
/>
|
||||
<FormDivider />
|
||||
<FormRow
|
||||
|
|
Loading…
Reference in a new issue