Merge pull request #13813 from desktop/Enable-manual-check-for-updates-on-test

Enable manual "check for updates" on test builds
This commit is contained in:
tidy-dev 2022-02-03 11:30:48 -05:00 committed by GitHub
commit f54b3aa508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 30 deletions

View file

@ -90,8 +90,8 @@ export async function getChangeLog(
'https://central.github.com/deployments/desktop/desktop/changelog.json'
)
if (__RELEASE_CHANNEL__ === 'beta') {
changelogURL.searchParams.set('env', 'beta')
if (__RELEASE_CHANNEL__ === 'beta' || __RELEASE_CHANNEL__ === 'test') {
changelogURL.searchParams.set('env', __RELEASE_CHANNEL__)
}
if (limit !== undefined) {

View file

@ -95,10 +95,7 @@ export class About extends React.Component<IAboutProps, IAboutState> {
}
private renderUpdateButton() {
if (
__RELEASE_CHANNEL__ === 'development' ||
__RELEASE_CHANNEL__ === 'test'
) {
if (__RELEASE_CHANNEL__ === 'development') {
return null
}
@ -180,14 +177,11 @@ export class About extends React.Component<IAboutProps, IAboutState> {
return null
}
if (
__RELEASE_CHANNEL__ === 'development' ||
__RELEASE_CHANNEL__ === 'test'
) {
if (__RELEASE_CHANNEL__ === 'development') {
return (
<p>
The application is currently running in development or test mode and
will not receive any updates.
The application is currently running in development and will not
receive any updates.
</p>
)
}
@ -216,10 +210,7 @@ export class About extends React.Component<IAboutProps, IAboutState> {
return null
}
if (
__RELEASE_CHANNEL__ === 'development' ||
__RELEASE_CHANNEL__ === 'test'
) {
if (__RELEASE_CHANNEL__ === 'development') {
return null
}

View file

@ -253,10 +253,7 @@ export class App extends React.Component<IAppProps, IAppState> {
const status = state.status
if (
!(
__RELEASE_CHANNEL__ === 'development' ||
__RELEASE_CHANNEL__ === 'test'
) &&
!(__RELEASE_CHANNEL__ === 'development') &&
status === UpdateStatus.UpdateReady
) {
this.props.dispatcher.setUpdateBannerVisibility(true)
@ -302,8 +299,14 @@ export class App extends React.Component<IAppProps, IAppState> {
this.props.dispatcher.installGlobalLFSFilters(false)
setInterval(() => this.checkForUpdates(true), UpdateCheckInterval)
this.checkForUpdates(true)
// We only want to automatically check for updates on beta and prod
if (
__RELEASE_CHANNEL__ !== 'development' &&
__RELEASE_CHANNEL__ !== 'test'
) {
setInterval(() => this.checkForUpdates(true), UpdateCheckInterval)
this.checkForUpdates(true)
}
log.info(`launching: ${getVersion()} (${getOS()})`)
log.info(`execPath: '${process.execPath}'`)
@ -555,14 +558,7 @@ export class App extends React.Component<IAppProps, IAppState> {
}
private checkForUpdates(inBackground: boolean) {
if (__LINUX__) {
return
}
if (
__RELEASE_CHANNEL__ === 'development' ||
__RELEASE_CHANNEL__ === 'test'
) {
if (__LINUX__ || __RELEASE_CHANNEL__ === 'development') {
return
}