Compare commits
4 Commits
main
...
pierremtb/
Author | SHA1 | Date | |
---|---|---|---|
e82bb4dc39 | |||
1c4e3da07c | |||
5528dc46e8 | |||
aec184de51 |
@ -12,11 +12,11 @@ import { NetworkHealthIndicator } from '@src/components/NetworkHealthIndicator'
|
|||||||
import { NetworkMachineIndicator } from '@src/components/NetworkMachineIndicator'
|
import { NetworkMachineIndicator } from '@src/components/NetworkMachineIndicator'
|
||||||
import Tooltip from '@src/components/Tooltip'
|
import Tooltip from '@src/components/Tooltip'
|
||||||
import { useAbsoluteFilePath } from '@src/hooks/useAbsoluteFilePath'
|
import { useAbsoluteFilePath } from '@src/hooks/useAbsoluteFilePath'
|
||||||
import { openExternalBrowserIfDesktop } from '@src/lib/openWindow'
|
|
||||||
import { PATHS } from '@src/lib/paths'
|
import { PATHS } from '@src/lib/paths'
|
||||||
import { APP_VERSION, getReleaseUrl } from '@src/routes/utils'
|
import { APP_VERSION, getReleaseUrl } from '@src/routes/utils'
|
||||||
|
|
||||||
import { billingActor } from '@src/lib/singletons'
|
import { billingActor } from '@src/lib/singletons'
|
||||||
|
import { ActionButton } from '@src/components/ActionButton'
|
||||||
|
|
||||||
export function LowerRightControls({
|
export function LowerRightControls({
|
||||||
children,
|
children,
|
||||||
@ -52,15 +52,16 @@ export function LowerRightControls({
|
|||||||
<BillingDialog billingActor={billingActor} />
|
<BillingDialog billingActor={billingActor} />
|
||||||
</Popover.Panel>
|
</Popover.Panel>
|
||||||
</Popover>
|
</Popover>
|
||||||
<a
|
<ActionButton
|
||||||
onClick={openExternalBrowserIfDesktop(getReleaseUrl())}
|
Element="externalLink"
|
||||||
href={getReleaseUrl()}
|
to={getReleaseUrl()}
|
||||||
target="_blank"
|
className={
|
||||||
rel="noopener noreferrer"
|
'!no-underline !border-none font-mono text-xs' +
|
||||||
className={'!no-underline font-mono text-xs ' + linkOverrideClassName}
|
linkOverrideClassName
|
||||||
|
}
|
||||||
>
|
>
|
||||||
v{APP_VERSION}
|
v{APP_VERSION}
|
||||||
</a>
|
</ActionButton>
|
||||||
<Link
|
<Link
|
||||||
to={
|
to={
|
||||||
location.pathname.includes(PATHS.FILE)
|
location.pathname.includes(PATHS.FILE)
|
||||||
|
@ -5,7 +5,7 @@ import toast from 'react-hot-toast'
|
|||||||
import { ActionButton } from '@src/components/ActionButton'
|
import { ActionButton } from '@src/components/ActionButton'
|
||||||
import { SafeRenderer } from '@src/lib/markdown'
|
import { SafeRenderer } from '@src/lib/markdown'
|
||||||
import { openExternalBrowserIfDesktop } from '@src/lib/openWindow'
|
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({
|
export function ToastUpdate({
|
||||||
version,
|
version,
|
||||||
@ -41,16 +41,20 @@ export function ToastUpdate({
|
|||||||
v{version}
|
v{version}
|
||||||
</span>
|
</span>
|
||||||
<p className="ml-4 text-md text-bold">
|
<p className="ml-4 text-md text-bold">
|
||||||
A new update has downloaded and will be available next time you
|
A new update is available.
|
||||||
start the app. You can view the release notes{' '}
|
{!IS_NIGHTLY_OR_DEBUG && (
|
||||||
<a
|
<span>
|
||||||
onClick={openExternalBrowserIfDesktop(getReleaseUrl(version))}
|
You can view the release notes{' '}
|
||||||
href={getReleaseUrl(version)}
|
<a
|
||||||
target="_blank"
|
onClick={openExternalBrowserIfDesktop(getReleaseUrl(version))}
|
||||||
rel="noreferrer"
|
href={getReleaseUrl(version)}
|
||||||
>
|
target="_blank"
|
||||||
here on GitHub.
|
rel="noreferrer"
|
||||||
</a>
|
>
|
||||||
|
here on GitHub.
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{releaseNotes && (
|
{releaseNotes && (
|
||||||
|
@ -446,9 +446,6 @@ export function getAutoUpdater(): AppUpdater {
|
|||||||
// Using destructuring to access autoUpdater due to the CommonJS module of 'electron-updater'.
|
// 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.
|
// It is a workaround for ESM compatibility issues, see https://github.com/electron-userland/electron-builder/issues/7976.
|
||||||
const { autoUpdater } = electronUpdater
|
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
|
return autoUpdater
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,6 +459,9 @@ app.on('ready', () => {
|
|||||||
// TODO: we're getting `Error: Response ends without calling any handlers` with our setup,
|
// TODO: we're getting `Error: Response ends without calling any handlers` with our setup,
|
||||||
// so at the moment this isn't worth enabling
|
// so at the moment this isn't worth enabling
|
||||||
autoUpdater.disableDifferentialDownload = true
|
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(() => {
|
setTimeout(() => {
|
||||||
autoUpdater.checkForUpdates().catch(reportRejection)
|
autoUpdater.checkForUpdates().catch(reportRejection)
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
@ -22,7 +22,9 @@ export const IS_NIGHTLY_OR_DEBUG =
|
|||||||
IS_NIGHTLY || APP_VERSION === '0.0.0' || APP_VERSION === '11.22.33'
|
IS_NIGHTLY || APP_VERSION === '0.0.0' || APP_VERSION === '11.22.33'
|
||||||
|
|
||||||
export function getReleaseUrl(version: string = APP_VERSION) {
|
export function getReleaseUrl(version: string = APP_VERSION) {
|
||||||
return `https://github.com/KittyCAD/modeling-app/releases/tag/${
|
if (IS_NIGHTLY_OR_DEBUG || version === 'main') {
|
||||||
IS_NIGHTLY ? 'nightly-' : ''
|
return 'https://github.com/KittyCAD/modeling-app/commits/main'
|
||||||
}v${version}`
|
}
|
||||||
|
|
||||||
|
return `https://github.com/KittyCAD/modeling-app/releases/tag/v${version}`
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user