Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

simplify logic for pull request OTAs (#8720)

* simplify logic for pull request OTAs

* just render deep link in the text

* dont download update until approved

authored by

hailey and committed by
GitHub
15abdc67 c6b578fe

+27 -63
+2 -4
.github/workflows/pull-request-comment.yml
··· 168 168 header: pull-request-eas-build-${{ github.sha }} 169 169 number: ${{ github.event.issue.number }} 170 170 message: | 171 - Your requested OTA deployment was successful! You may now apply it by pressing the link below. 172 - 173 - [Apply OTA update](bluesky://intent/apply-ota?channel=pull-request-${{ github.event.issue.number }}) 171 + Your requested OTA deployment was successful! You may now apply it by opening the deep link below in your browser: 174 172 175 - [Here is some music to listen to while you wait...](https://www.youtube.com/watch?v=VBlFHuCzPgY) 173 + `bluesky://intent/apply-ota?channel=pull-request-${{ github.event.issue.number }}` 176 174 --- 177 175 *Generated by [PR labeler](https://github.com/expo/expo/actions/workflows/pr-labeler.yml) 🤖* 178 176
+1 -2
app.config.js
··· 26 26 ...(IS_DEV || IS_TESTFLIGHT ? [] : []), 27 27 ] 28 28 29 - const UPDATES_ENABLED = 30 - IS_TESTFLIGHT !== undefined || IS_PRODUCTION !== undefined 29 + const UPDATES_ENABLED = IS_TESTFLIGHT || IS_PRODUCTION 31 30 32 31 const USE_SENTRY = Boolean(process.env.SENTRY_AUTH_TOKEN) 33 32
+24 -57
src/lib/hooks/useOTAUpdates.ts
··· 45 45 const res = await checkForUpdateAsync() 46 46 if (res.isAvailable) { 47 47 await fetchUpdateAsync() 48 - 49 48 Alert.alert( 50 49 'Update Available', 51 50 'A new version of the app is available. Relaunch now?', ··· 70 69 const {currentlyRunning} = useUpdates() 71 70 const [pending, setPending] = React.useState(false) 72 71 const currentChannel = currentlyRunning?.channel 73 - const isCurrentlyRunningPullRequestDeployment = 74 - currentChannel?.startsWith('pull-request') 75 72 76 73 const tryApplyUpdate = async (channel: string) => { 77 74 setPending(true) 78 - if (currentChannel === channel) { 79 - const res = await checkForUpdateAsync() 80 - if (res.isAvailable) { 81 - logger.debug('Attempting to fetch update...') 82 - await fetchUpdateAsync() 83 - Alert.alert( 84 - 'Deployment Available', 85 - `A new deployment of ${channel} is availalble. Relaunch now?`, 86 - [ 87 - { 88 - text: 'No', 89 - style: 'cancel', 75 + await setExtraParamsPullRequest(channel) 76 + const res = await checkForUpdateAsync() 77 + if (res.isAvailable) { 78 + Alert.alert( 79 + 'Deployment Available', 80 + `A deployment of ${channel} is availalble. Applying this deployment may result in a bricked installation, in which case you will need to reinstall the app and may lose local data. Are you sure you want to proceed?`, 81 + [ 82 + { 83 + text: 'No', 84 + style: 'cancel', 85 + }, 86 + { 87 + text: 'Relaunch', 88 + style: 'default', 89 + onPress: async () => { 90 + await fetchUpdateAsync() 91 + await reloadAsync() 90 92 }, 91 - { 92 - text: 'Relaunch', 93 - style: 'default', 94 - onPress: async () => { 95 - await reloadAsync() 96 - }, 97 - }, 98 - ], 99 - ) 100 - } else { 101 - Alert.alert( 102 - 'No Deployment Available', 103 - `No new deployments of ${channel} are currently available for your current native build.`, 104 - ) 105 - } 93 + }, 94 + ], 95 + ) 106 96 } else { 107 - setExtraParamsPullRequest(channel) 108 - const res = await checkForUpdateAsync() 109 - if (res.isAvailable) { 110 - Alert.alert( 111 - 'Deployment Available', 112 - `A deployment of ${channel} is availalble. Applying this deployment may result in a bricked installation, in which case you will need to reinstall the app and may lose local data. Are you sure you want to proceed?`, 113 - [ 114 - { 115 - text: 'No', 116 - style: 'cancel', 117 - }, 118 - { 119 - text: 'Relaunch', 120 - style: 'default', 121 - onPress: async () => { 122 - await reloadAsync() 123 - }, 124 - }, 125 - ], 126 - ) 127 - } else { 128 - Alert.alert( 129 - 'No Deployment Available', 130 - `No new deployments of ${channel} are currently available for your current native build.`, 131 - ) 132 - } 97 + Alert.alert( 98 + 'No Deployment Available', 99 + `No new deployments of ${channel} are currently available for your current native build.`, 100 + ) 133 101 } 134 102 setPending(false) 135 103 } ··· 146 114 tryApplyUpdate, 147 115 revertToEmbedded, 148 116 currentChannel, 149 - isCurrentlyRunningPullRequestDeployment, 150 117 pending, 151 118 } 152 119 }