Skip to content

Commit

Permalink
fix(Settings.tsx): Prevent app crashes with unknown environment varia…
Browse files Browse the repository at this point in the history
…bles
  • Loading branch information
KingRainbow44 committed Jul 31, 2024
1 parent 0d69c22 commit 69f59e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions .env

This file was deleted.

7 changes: 4 additions & 3 deletions src/ui/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { toIconUrl, validateAddress, validateSocket } from "@backend/utils";

import { DarkTheme, LightTheme, value } from "@style/Laudiolin";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import Backend from "@backend/backend";

interface SettingProps {
title: string;
Expand Down Expand Up @@ -248,16 +249,16 @@ function Settings() {
</Section>

<Section title={"Links"}>
<TouchableOpacity onPress={() => Linking.openURL(process.env.EXPO_PUBLIC_TOS_URL ?? "")}>
<TouchableOpacity onPress={() => Linking.openURL(`${Backend.getBaseUrl()}/tos`)}>
<StyledText text={"Terms of Service"} underlined size={Size.Footnote} />
</TouchableOpacity>

<TouchableOpacity onPress={() => Linking.openURL(process.env.EXPO_PUBLIC_PRIVACY_URL ?? "")}>
<TouchableOpacity onPress={() => Linking.openURL(`${Backend.getBaseUrl()}/privacy`)}>
<StyledText text={"Privacy Policy"} underlined size={Size.Footnote} />
</TouchableOpacity>

{ user && (
<TouchableOpacity onPress={() => Linking.openURL(process.env.EXPO_PUBLIC_DELETE_ACCOUNT ?? "")}>
<TouchableOpacity onPress={() => Linking.openURL(`${Backend.getBaseUrl()}/delete`)}>
<StyledText text={"Delete Account"} underlined size={Size.Footnote} style={{ color: colors.red }} />
</TouchableOpacity>
) }
Expand Down

0 comments on commit 69f59e6

Please sign in to comment.