Figure out structuring the node-browser boundary

This commit is contained in:
49lf
2024-07-23 21:10:21 -04:00
parent 15698c6d42
commit d49ecc4926
6 changed files with 23 additions and 27 deletions

View File

@ -8,10 +8,6 @@ import { ProjectRoute } from 'wasm-lib/kcl/bindings/ProjectRoute'
import { components } from './machine-api'
import { isDesktop } from './isDesktop'
// All these functions call into lib/electron since many require filesystem
// access, and the second half is the original tauri code also stored app
// state on the "desktop" side.
// Get the app state from desktop.
export async function getState(): Promise<ProjectState | undefined> {
if (!isDesktop()) {
@ -45,7 +41,7 @@ export async function renameProjectDirectory(
projectPath: string,
newName: string
): Promise<string> {
return invoke<string>('rename_project_directory', { projectPath, newName })
return window.electron.ipcRenderer.invoke<string>('rename_project_directory', { projectPath, newName })
}
// Get the initial default dir for holding all projects.