diff --git a/src/apps/ProjectList.tsx b/src/apps/ProjectList.tsx index 1dfa830..f438e6e 100644 --- a/src/apps/ProjectList.tsx +++ b/src/apps/ProjectList.tsx @@ -4,7 +4,7 @@ import './ProjectList.css' import {mkdir, exists, readTextFile, writeTextFile} from "@tauri-apps/plugin-fs"; import {appLocalDataDir} from "@tauri-apps/api/path"; import {clearProjectPage} from "../routes/project/ProjectPage.tsx"; -import {logError} from "@tauri-apps/cli/index"; +import {path} from "@tauri-apps/api"; let PROJECT_JSON: Array = [] @@ -22,7 +22,7 @@ export function ProjectList() { try { clearProjectPage() let parsed; - const dir = await appLocalDataDir() + "/temp/"; + let dir = await appLocalDataDir() + path.sep() + "temp" + path.sep(); if (!await exists(dir)) { await mkdir(dir, { recursive: true diff --git a/src/main.tsx b/src/main.tsx index 08d54c6..91aef4d 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -9,7 +9,6 @@ import AppsPage from "./routes/apps/AppsPage.tsx"; import {TitleBar} from "./components/TitleBar.tsx"; import SideBar from "./components/SideBar.tsx"; import ProjectPage from "./routes/project/ProjectPage.tsx"; -import {webviewWindow} from "@tauri-apps/api"; const router = createHashRouter([ { diff --git a/src/routes/project/ProjectPage.tsx b/src/routes/project/ProjectPage.tsx index ce6e39f..bf5b931 100644 --- a/src/routes/project/ProjectPage.tsx +++ b/src/routes/project/ProjectPage.tsx @@ -6,6 +6,7 @@ import './ProjectPage.css'; import {appLocalDataDir} from "@tauri-apps/api/path"; import {DownloadInfo, setOnProgress} from "../home/HomePage.tsx"; import {invoke} from "@tauri-apps/api/core"; +import {path} from "@tauri-apps/api"; async function downloadProject(id: string) { const meta_url = "https://ultreon.dev/cdn/project/" + id + ".dl_meta.json" @@ -49,11 +50,11 @@ export default function ProjectPage() { return } if (projectId !== null && projectObject !== null) return - const dir = await appLocalDataDir() + "/temp"; - if (!await exists(dir + "/page-open-intent.json")) return + const dir = await appLocalDataDir() + path.sep() + "temp"; + if (!await exists(dir + path.sep() + "page-open-intent.json")) return let parsed; try { - parsed = JSON.parse(await readTextFile(dir + "/page-open-intent.json")); + parsed = JSON.parse(await readTextFile(dir + path.sep() + "page-open-intent.json")); } catch (error) { console.error(error) setError(error?.toString() ?? "Unknown error");