From 8621ecd38a4b912f77602fb99e6d540f99727c9f Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Wed, 26 Jun 2024 15:28:31 +0100 Subject: [PATCH] disable enabling adult content on iOS (#4651) --- src/screens/Moderation/index.tsx | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/screens/Moderation/index.tsx b/src/screens/Moderation/index.tsx index a874e745..9342a805 100644 --- a/src/screens/Moderation/index.tsx +++ b/src/screens/Moderation/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import {View} from 'react-native' +import {Linking, View} from 'react-native' import {useSafeAreaFrame} from 'react-native-safe-area-context' import {ComAtprotoLabelDefs} from '@atproto/api' import {LABELS} from '@atproto/api' @@ -10,6 +10,7 @@ import {useFocusEffect} from '@react-navigation/native' import {getLabelingServiceTitle} from '#/lib/moderation' import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types' import {logger} from '#/logger' +import {isIOS} from '#/platform/detection' import { useMyLabelersQuery, usePreferencesQuery, @@ -202,6 +203,8 @@ export function ModerationScreenInner({ [setAdultContentPref], ) + const disabledOnIOS = isIOS && !adultContentEnabled + return ( Enable adult content @@ -345,6 +350,25 @@ export function ModerationScreenInner({ + {disabledOnIOS && ( + + + + Adult content can only be enabled via the Web at{' '} + { + evt.preventDefault() + Linking.openURL('https://bsky.app/') + return false + }}> + bsky.app + + . + + + + )} )}