From 968374464e8d9a1f39faef8bd59f7ab9fcf0ec3e Mon Sep 17 00:00:00 2001 From: Hailey Date: Thu, 24 Jul 2025 21:06:41 -0700 Subject: [PATCH] add a debug button --- app.config.js | 8 ++----- src/lib/hooks/useIntentHandler.ts | 5 ---- src/screens/Settings/Settings.tsx | 38 +++++++++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/app.config.js b/app.config.js index e065d0d737..26d1dcae50 100644 --- a/app.config.js +++ b/app.config.js @@ -26,12 +26,8 @@ module.exports = function (_config) { ...(IS_DEV || IS_TESTFLIGHT ? [] : []), ] - const UPDATES_CHANNEL = IS_TESTFLIGHT - ? 'testflight' - : IS_PRODUCTION - ? 'production' - : undefined - const UPDATES_ENABLED = !!UPDATES_CHANNEL + const UPDATES_ENABLED = + IS_TESTFLIGHT !== undefined || IS_PRODUCTION !== undefined const USE_SENTRY = Boolean(process.env.SENTRY_AUTH_TOKEN) diff --git a/src/lib/hooks/useIntentHandler.ts b/src/lib/hooks/useIntentHandler.ts index f55217e567..c359b2bd65 100644 --- a/src/lib/hooks/useIntentHandler.ts +++ b/src/lib/hooks/useIntentHandler.ts @@ -13,7 +13,6 @@ import { } from '#/components/ageAssurance/AgeAssuranceRedirectDialog' import {useIntentDialogs} from '#/components/intents/IntentDialogs' import {Referrer} from '../../../modules/expo-bluesky-swiss-army' -import {IS_TESTFLIGHT} from '../app-info.web' import {useApplyPullRequestOTAUpdate} from './useOTAUpdates' type IntentType = 'compose' | 'verify-email' | 'age-assurance' | 'apply-ota' @@ -97,10 +96,6 @@ export function useIntentHandler() { return } case 'apply-ota': { - if (!isNative || !IS_TESTFLIGHT) { - return - } - const channel = params.get('channel') if (!channel) { Alert.alert('Error', 'No channel provided to look for.') diff --git a/src/screens/Settings/Settings.tsx b/src/screens/Settings/Settings.tsx index 9596c24794..b712c054cb 100644 --- a/src/screens/Settings/Settings.tsx +++ b/src/screens/Settings/Settings.tsx @@ -1,5 +1,5 @@ import {useState} from 'react' -import {LayoutAnimation, Pressable, View} from 'react-native' +import {Alert, LayoutAnimation, Pressable, View} from 'react-native' import {Linking} from 'react-native' import {useReducedMotion} from 'react-native-reanimated' import {type AppBskyActorDefs, moderateProfile} from '@atproto/api' @@ -19,7 +19,7 @@ import { } from '#/lib/routes/types' import {sanitizeDisplayName} from '#/lib/strings/display-names' import {sanitizeHandle} from '#/lib/strings/handles' -import {isNative} from '#/platform/detection' +import {isIOS, isNative} from '#/platform/detection' import {useProfileShadow} from '#/state/cache/profile-shadow' import * as persisted from '#/state/persisted' import {clearStorage} from '#/state/persisted' @@ -367,6 +367,7 @@ function DevOptions() { const navigation = useNavigation() const {mutate: deleteChatDeclarationRecord} = useDeleteActorDeclaration() const { + tryApplyUpdate, revertToEmbedded, isCurrentlyRunningPullRequestDeployment, currentChannel, @@ -399,6 +400,30 @@ function DevOptions() { setActyNotifNudged(false) } + const onPressApplyOta = () => { + Alert.prompt( + 'Apply OTA', + 'Enter the channel for the OTA you wish to apply.', + [ + { + style: 'cancel', + text: 'Cancel', + }, + { + style: 'default', + text: 'Apply', + onPress: channel => { + tryApplyUpdate(channel ?? '') + }, + }, + ], + 'plain-text', + isCurrentlyRunningPullRequestDeployment + ? currentChannel + : 'pull-request-', + ) + } + return ( <> Clear all storage data (restart after this) + {isIOS ? ( + + + Apply Pull Request + + + ) : null} {isNative && isCurrentlyRunningPullRequestDeployment ? (