chore: updated all VITE_KC_SITE_BASE_URL locations, need to do raw urls next

This commit is contained in:
Kevin
2025-07-02 14:09:39 -05:00
parent e5d1cd847d
commit 14a72344e2
7 changed files with 14 additions and 15 deletions

View File

@ -53,7 +53,6 @@ import {
WASM_INIT_FAILED_TOAST_ID,
} from '@src/lib/constants'
import { isPlaywright } from '@src/lib/isPlaywright'
import { VITE_KC_SITE_BASE_URL } from '@src/env'
import { useNetworkHealthStatus } from '@src/components/NetworkHealthIndicator'
import { useNetworkMachineStatus } from '@src/components/NetworkMachineIndicator'
import {
@ -65,6 +64,7 @@ import { useModelingContext } from '@src/hooks/useModelingContext'
import { xStateValueToString } from '@src/lib/xStateValueToString'
import { getSelectionTypeDisplayText } from '@src/lib/selections'
import type { StatusBarItemType } from '@src/components/StatusBar/statusBarTypes'
import {withSiteBaseURL} from '@src/lib/withBaseURL'
// CYCLIC REF
sceneInfra.camControls.engineStreamActor = engineStreamActor
@ -189,7 +189,8 @@ export function App() {
() =>
DownloadAppToast({
onAccept: () => {
openWindow(`${VITE_KC_SITE_BASE_URL}/${APP_DOWNLOAD_PATH}`)
const url = withSiteBaseURL(`/${APP_DOWNLOAD_PATH}`)
openWindow(url)
.then(() => {
toast.dismiss(DOWNLOAD_APP_TOAST_ID)
})

View File

@ -1,5 +1,4 @@
import { Transition } from '@headlessui/react'
import { VITE_KC_SITE_BASE_URL } from '@src/env'
import { useSearchParams } from 'react-router-dom'
import { base64ToString } from '@src/lib/base64'

View File

@ -12,9 +12,9 @@ import { Popover } from '@headlessui/react'
import Tooltip from '@src/components/Tooltip'
import { HelpMenu } from '@src/components/HelpMenu'
import { isDesktop } from '@src/lib/isDesktop'
import { VITE_KC_SITE_BASE_URL } from '@src/env'
import { APP_DOWNLOAD_PATH } from '@src/lib/constants'
import { desktopAppPitchMessage } from '@src/components/DownloadAppToast'
import { withSiteBaseURL} from '@src/lib/withBaseURL'
export const defaultGlobalStatusBarItems = ({
location,
@ -37,7 +37,7 @@ export const defaultGlobalStatusBarItems = ({
id: 'download-desktop-app',
element: 'externalLink',
label: 'Download the app',
href: `${VITE_KC_SITE_BASE_URL}/${APP_DOWNLOAD_PATH}`,
href: withSiteBaseURL(`/${APP_DOWNLOAD_PATH}`),
icon: 'download',
toolTip: {
children: desktopAppPitchMessage,

View File

@ -1,7 +1,6 @@
import type { SelectionRange } from '@codemirror/state'
import { EditorSelection, Transaction } from '@codemirror/state'
import type { Models } from '@kittycad/lib'
import { VITE_KC_SITE_BASE_URL } from '@src/env'
import { diffLines } from 'diff'
import toast from 'react-hot-toast'
import type { TextToCadMultiFileIteration_type } from '@kittycad/lib/dist/types/src/models'
@ -28,7 +27,7 @@ import { uuidv4 } from '@src/lib/utils'
import type { File as KittyCadLibFile } from '@kittycad/lib/dist/types/src/models'
import type { FileMeta } from '@src/lib/types'
import type { RequestedKCLFile } from '@src/machines/systemIO/utils'
import { withAPIBaseURL } from '@src/lib/withBaseURL'
import { withAPIBaseURL, withSiteBaseURL } from '@src/lib/withBaseURL'
type KclFileMetaMap = {
[execStateFileNamesIndex: number]: Extract<FileMeta, { type: 'kcl' }>
@ -439,7 +438,7 @@ export async function promptToEditFlow({
return Promise.reject(result)
}
const oldCodeWebAppOnly = codeManager.code
const downloadLink = `${VITE_KC_SITE_BASE_URL}/${APP_DOWNLOAD_PATH}`
const downloadLink = withSiteBaseURL(`/${APP_DOWNLOAD_PATH}`)
if (!isDesktop() && Object.values(result.outputs).length > 1) {
const toastId = uuidv4()

View File

@ -30,7 +30,7 @@ import {
browserAxialFan,
browserAxialFanAfterTextToCad,
} from '@src/lib/exampleKcl'
import {withSiteBaseURL} from "@src/lib/withBaseURL"
import { withSiteBaseURL } from '@src/lib/withBaseURL'
type BrowserOnboaringRoute = RouteObject & {
path: keyof typeof browserOnboardingPaths

View File

@ -642,9 +642,7 @@ function OnboardingConclusion() {
project, click the Zoo button in the top left. To learn more detailed
and advanced techniques,{' '}
<a
onClick={openExternalBrowserIfDesktop(
withSiteBaseURL('/docs')
)}
onClick={openExternalBrowserIfDesktop(withSiteBaseURL('/docs'))}
href={`${withSiteBaseURL('/docs')}`}
>
check out our docs

View File

@ -55,5 +55,7 @@ export function generateSignInUrl() {
'?'
)
return withSiteBaseURL(`${PATHS.SIGN_IN}?callbackUrl=${encodeURIComponent(finalURL)}`)
return withSiteBaseURL(
`${PATHS.SIGN_IN}?callbackUrl=${encodeURIComponent(finalURL)}`
)
}