Fix: Follow up Text-to-CAD Edit to fix in browser (#7124)

* fix: web vs desktop who wins

* fix: fixed logic round two :(
This commit is contained in:
Kevin Nadro
2025-05-20 16:11:31 -05:00
committed by GitHub
parent ce63c6423e
commit eca09984a3

View File

@ -1278,12 +1278,12 @@ export const ModelingMachineProvider = ({
)
}
}
let filePath = file?.path
// When prompt to edit finishes, try to route to the file they were in otherwise go to main.kcl
if (filePath) {
filePath = window.electron.path.relative(basePath, filePath)
} else {
filePath = PROJECT_ENTRYPOINT
// route to main.kcl by default for web and desktop
let filePath: string = PROJECT_ENTRYPOINT
const possibleFileName = file?.path
if (possibleFileName && isDesktop()) {
// When prompt to edit finishes, try to route to the file they were in otherwise go to main.kcl
filePath = window.electron.path.relative(basePath, possibleFileName)
}
return await promptToEditFlow({
projectFiles,