add a debug button
This commit is contained in:
+2
-6
@@ -26,12 +26,8 @@ module.exports = function (_config) {
|
|||||||
...(IS_DEV || IS_TESTFLIGHT ? [] : []),
|
...(IS_DEV || IS_TESTFLIGHT ? [] : []),
|
||||||
]
|
]
|
||||||
|
|
||||||
const UPDATES_CHANNEL = IS_TESTFLIGHT
|
const UPDATES_ENABLED =
|
||||||
? 'testflight'
|
IS_TESTFLIGHT !== undefined || IS_PRODUCTION !== undefined
|
||||||
: IS_PRODUCTION
|
|
||||||
? 'production'
|
|
||||||
: undefined
|
|
||||||
const UPDATES_ENABLED = !!UPDATES_CHANNEL
|
|
||||||
|
|
||||||
const USE_SENTRY = Boolean(process.env.SENTRY_AUTH_TOKEN)
|
const USE_SENTRY = Boolean(process.env.SENTRY_AUTH_TOKEN)
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import {
|
|||||||
} from '#/components/ageAssurance/AgeAssuranceRedirectDialog'
|
} from '#/components/ageAssurance/AgeAssuranceRedirectDialog'
|
||||||
import {useIntentDialogs} from '#/components/intents/IntentDialogs'
|
import {useIntentDialogs} from '#/components/intents/IntentDialogs'
|
||||||
import {Referrer} from '../../../modules/expo-bluesky-swiss-army'
|
import {Referrer} from '../../../modules/expo-bluesky-swiss-army'
|
||||||
import {IS_TESTFLIGHT} from '../app-info.web'
|
|
||||||
import {useApplyPullRequestOTAUpdate} from './useOTAUpdates'
|
import {useApplyPullRequestOTAUpdate} from './useOTAUpdates'
|
||||||
|
|
||||||
type IntentType = 'compose' | 'verify-email' | 'age-assurance' | 'apply-ota'
|
type IntentType = 'compose' | 'verify-email' | 'age-assurance' | 'apply-ota'
|
||||||
@@ -97,10 +96,6 @@ export function useIntentHandler() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
case 'apply-ota': {
|
case 'apply-ota': {
|
||||||
if (!isNative || !IS_TESTFLIGHT) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const channel = params.get('channel')
|
const channel = params.get('channel')
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
Alert.alert('Error', 'No channel provided to look for.')
|
Alert.alert('Error', 'No channel provided to look for.')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {useState} from 'react'
|
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 {Linking} from 'react-native'
|
||||||
import {useReducedMotion} from 'react-native-reanimated'
|
import {useReducedMotion} from 'react-native-reanimated'
|
||||||
import {type AppBskyActorDefs, moderateProfile} from '@atproto/api'
|
import {type AppBskyActorDefs, moderateProfile} from '@atproto/api'
|
||||||
@@ -19,7 +19,7 @@ import {
|
|||||||
} from '#/lib/routes/types'
|
} from '#/lib/routes/types'
|
||||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
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 {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||||
import * as persisted from '#/state/persisted'
|
import * as persisted from '#/state/persisted'
|
||||||
import {clearStorage} from '#/state/persisted'
|
import {clearStorage} from '#/state/persisted'
|
||||||
@@ -367,6 +367,7 @@ function DevOptions() {
|
|||||||
const navigation = useNavigation<NavigationProp>()
|
const navigation = useNavigation<NavigationProp>()
|
||||||
const {mutate: deleteChatDeclarationRecord} = useDeleteActorDeclaration()
|
const {mutate: deleteChatDeclarationRecord} = useDeleteActorDeclaration()
|
||||||
const {
|
const {
|
||||||
|
tryApplyUpdate,
|
||||||
revertToEmbedded,
|
revertToEmbedded,
|
||||||
isCurrentlyRunningPullRequestDeployment,
|
isCurrentlyRunningPullRequestDeployment,
|
||||||
currentChannel,
|
currentChannel,
|
||||||
@@ -399,6 +400,30 @@ function DevOptions() {
|
|||||||
setActyNotifNudged(false)
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<SettingsList.PressableItem
|
<SettingsList.PressableItem
|
||||||
@@ -459,6 +484,15 @@ function DevOptions() {
|
|||||||
<Trans>Clear all storage data (restart after this)</Trans>
|
<Trans>Clear all storage data (restart after this)</Trans>
|
||||||
</SettingsList.ItemText>
|
</SettingsList.ItemText>
|
||||||
</SettingsList.PressableItem>
|
</SettingsList.PressableItem>
|
||||||
|
{isIOS ? (
|
||||||
|
<SettingsList.PressableItem
|
||||||
|
onPress={onPressApplyOta}
|
||||||
|
label={_(msg`Apply Pull Request`)}>
|
||||||
|
<SettingsList.ItemText>
|
||||||
|
<Trans>Apply Pull Request</Trans>
|
||||||
|
</SettingsList.ItemText>
|
||||||
|
</SettingsList.PressableItem>
|
||||||
|
) : null}
|
||||||
{isNative && isCurrentlyRunningPullRequestDeployment ? (
|
{isNative && isCurrentlyRunningPullRequestDeployment ? (
|
||||||
<SettingsList.PressableItem
|
<SettingsList.PressableItem
|
||||||
onPress={revertToEmbedded}
|
onPress={revertToEmbedded}
|
||||||
|
|||||||
Reference in New Issue
Block a user