Skip to content

Commit 596698b

Browse files
authored
Link to staging downloads in non-production builds (#7831)
* Link to staging downloads in non-production builds * Move download path to route utils
1 parent 8596cae commit 596698b

File tree

7 files changed

+8
-6
lines changed

7 files changed

+8
-6
lines changed

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ import { DownloadAppToast } from '@src/components/DownloadAppToast'
4747
import { WasmErrToast } from '@src/components/WasmErrToast'
4848
import openWindow from '@src/lib/openWindow'
4949
import {
50-
APP_DOWNLOAD_PATH,
5150
DOWNLOAD_APP_TOAST_ID,
5251
ONBOARDING_TOAST_ID,
5352
WASM_INIT_FAILED_TOAST_ID,
5453
} from '@src/lib/constants'
54+
import { APP_DOWNLOAD_PATH } from '@src/routes/utils'
5555
import { isPlaywright } from '@src/lib/isPlaywright'
5656
import { useNetworkHealthStatus } from '@src/components/NetworkHealthIndicator'
5757
import { useNetworkMachineStatus } from '@src/components/NetworkMachineIndicator'

src/components/OpenInDesktopAppHandler.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { base64ToString } from '@src/lib/base64'
44

55
import { ActionButton } from '@src/components/ActionButton'
66
import {
7-
APP_DOWNLOAD_PATH,
87
ASK_TO_OPEN_QUERY_PARAM,
98
ZOO_STUDIO_PROTOCOL,
109
} from '@src/lib/constants'
10+
import { APP_DOWNLOAD_PATH } from '@src/routes/utils'
1111
import { isDesktop } from '@src/lib/isDesktop'
1212
import { Themes, darkModeMatcher, setThemeClass } from '@src/lib/theme'
1313
import toast from 'react-hot-toast'

src/components/StatusBar/defaultStatusBarItems.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Popover } from '@headlessui/react'
1212
import Tooltip from '@src/components/Tooltip'
1313
import { HelpMenu } from '@src/components/HelpMenu'
1414
import { isDesktop } from '@src/lib/isDesktop'
15-
import { APP_DOWNLOAD_PATH } from '@src/lib/constants'
15+
import { APP_DOWNLOAD_PATH } from '@src/routes/utils'
1616
import { desktopAppPitchMessage } from '@src/components/DownloadAppToast'
1717
import { withSiteBaseURL } from '@src/lib/withBaseURL'
1818
import {

src/lib/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { Models } from '@kittycad/lib/dist/types/src'
33
import type { UnitAngle, UnitLength } from '@rust/kcl-lib/bindings/ModelingCmd'
44

55
export const APP_NAME = 'Design Studio'
6-
export const APP_DOWNLOAD_PATH = 'design-studio/download'
76
/** Search string in new project names to increment as an index */
87
export const INDEX_IDENTIFIER = '$n'
98
/** The maximum number of 0's to pad a default project name's index with */

src/lib/promptToEdit.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { diffLines } from 'diff'
55
import toast from 'react-hot-toast'
66
import type { TextToCadMultiFileIteration_type } from '@kittycad/lib/dist/types/src/models'
77
import { getCookie, TOKEN_PERSIST_KEY } from '@src/machines/authMachine'
8-
import { APP_DOWNLOAD_PATH, COOKIE_NAME } from '@src/lib/constants'
8+
import { COOKIE_NAME } from '@src/lib/constants'
9+
import { APP_DOWNLOAD_PATH } from '@src/routes/utils'
910
import { isDesktop } from '@src/lib/isDesktop'
1011
import { openExternalBrowserIfDesktop } from '@src/lib/openWindow'
1112
import { ActionButton } from '@src/components/ActionButton'

src/routes/Onboarding/BrowserOnboardingRoutes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import {
1717
ONBOARDING_DATA_ATTRIBUTE,
1818
BROWSER_PROJECT_NAME,
1919
PROJECT_ENTRYPOINT,
20-
APP_DOWNLOAD_PATH,
2120
} from '@src/lib/constants'
21+
import { APP_DOWNLOAD_PATH } from '@src/routes/utils'
2222
import { PATHS, joinRouterPaths } from '@src/lib/paths'
2323
import type { Selections } from '@src/lib/selections'
2424
import { systemIOActor, commandBarActor } from '@src/lib/singletons'

src/routes/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ export const IS_STAGING = PACKAGE_NAME.indexOf('-staging') > -1
5050
export const IS_STAGING_OR_DEBUG =
5151
IS_STAGING || APP_VERSION === '0.0.0' || APP_VERSION === 'dev'
5252

53+
export const APP_DOWNLOAD_PATH = `design-studio/download${IS_STAGING_OR_DEBUG ? '/staging' : ''}`
54+
5355
export function getRefFromVersion(version: string) {
5456
const hash = version.split('.').pop()
5557
if (hash && hash.length === 7) {

0 commit comments

Comments
 (0)