Compare commits

...

4 Commits

4 changed files with 32 additions and 25 deletions

View File

@ -12,11 +12,11 @@ import { NetworkHealthIndicator } from '@src/components/NetworkHealthIndicator'
import { NetworkMachineIndicator } from '@src/components/NetworkMachineIndicator'
import Tooltip from '@src/components/Tooltip'
import { useAbsoluteFilePath } from '@src/hooks/useAbsoluteFilePath'
import { openExternalBrowserIfDesktop } from '@src/lib/openWindow'
import { PATHS } from '@src/lib/paths'
import { APP_VERSION, getReleaseUrl } from '@src/routes/utils'
import { billingActor } from '@src/lib/singletons'
import { ActionButton } from '@src/components/ActionButton'
export function LowerRightControls({
children,
@ -52,15 +52,16 @@ export function LowerRightControls({
<BillingDialog billingActor={billingActor} />
</Popover.Panel>
</Popover>
<a
onClick={openExternalBrowserIfDesktop(getReleaseUrl())}
href={getReleaseUrl()}
target="_blank"
rel="noopener noreferrer"
className={'!no-underline font-mono text-xs ' + linkOverrideClassName}
<ActionButton
Element="externalLink"
to={getReleaseUrl()}
className={
'!no-underline !border-none font-mono text-xs' +
linkOverrideClassName
}
>
v{APP_VERSION}
</a>
</ActionButton>
<Link
to={
location.pathname.includes(PATHS.FILE)

View File

@ -5,7 +5,7 @@ import toast from 'react-hot-toast'
import { ActionButton } from '@src/components/ActionButton'
import { SafeRenderer } from '@src/lib/markdown'
import { openExternalBrowserIfDesktop } from '@src/lib/openWindow'
import { getReleaseUrl } from '@src/routes/utils'
import { getReleaseUrl, IS_NIGHTLY_OR_DEBUG } from '@src/routes/utils'
export function ToastUpdate({
version,
@ -41,16 +41,20 @@ export function ToastUpdate({
v{version}
</span>
<p className="ml-4 text-md text-bold">
A new update has downloaded and will be available next time you
start the app. You can view the release notes{' '}
<a
onClick={openExternalBrowserIfDesktop(getReleaseUrl(version))}
href={getReleaseUrl(version)}
target="_blank"
rel="noreferrer"
>
here on GitHub.
</a>
A new update is available.
{!IS_NIGHTLY_OR_DEBUG && (
<span>
You can view the release notes{' '}
<a
onClick={openExternalBrowserIfDesktop(getReleaseUrl(version))}
href={getReleaseUrl(version)}
target="_blank"
rel="noreferrer"
>
here on GitHub.
</a>
</span>
)}
</p>
</div>
{releaseNotes && (

View File

@ -446,9 +446,6 @@ export function getAutoUpdater(): AppUpdater {
// Using destructuring to access autoUpdater due to the CommonJS module of 'electron-updater'.
// It is a workaround for ESM compatibility issues, see https://github.com/electron-userland/electron-builder/issues/7976.
const { autoUpdater } = electronUpdater
// Allows us to rollback to a previous version if needed.
// See https://github.com/electron-userland/electron-builder/blob/7dbc6c77c340c869d1e7effa22135fc740003a0f/packages/electron-updater/src/AppUpdater.ts#L450-L451
autoUpdater.allowDowngrade = true
return autoUpdater
}
@ -462,6 +459,9 @@ app.on('ready', () => {
// TODO: we're getting `Error: Response ends without calling any handlers` with our setup,
// so at the moment this isn't worth enabling
autoUpdater.disableDifferentialDownload = true
// Allows us to rollback to a previous version if needed.
// See https://github.com/electron-userland/electron-builder/blob/7dbc6c77c340c869d1e7effa22135fc740003a0f/packages/electron-updater/src/AppUpdater.ts#L450-L451
autoUpdater.allowDowngrade = true
setTimeout(() => {
autoUpdater.checkForUpdates().catch(reportRejection)
}, 1000)

View File

@ -22,7 +22,9 @@ export const IS_NIGHTLY_OR_DEBUG =
IS_NIGHTLY || APP_VERSION === '0.0.0' || APP_VERSION === '11.22.33'
export function getReleaseUrl(version: string = APP_VERSION) {
return `https://github.com/KittyCAD/modeling-app/releases/tag/${
IS_NIGHTLY ? 'nightly-' : ''
}v${version}`
if (IS_NIGHTLY_OR_DEBUG || version === 'main') {
return 'https://github.com/KittyCAD/modeling-app/commits/main'
}
return `https://github.com/KittyCAD/modeling-app/releases/tag/v${version}`
}