Skip to content

Commit

Permalink
Use path.sep() instead of hardcoded '/'
Browse files Browse the repository at this point in the history
  • Loading branch information
XyperCode committed Oct 12, 2024
1 parent a8c598a commit 446b459
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/apps/ProjectList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProjectRef> = []

Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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([
{
Expand Down
7 changes: 4 additions & 3 deletions src/routes/project/ProjectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 446b459

Please sign in to comment.