diff --git a/app/src/data/ChartListWindowData.ts b/app/src/data/ChartListWindowData.ts index a29d4754..4b327292 100644 --- a/app/src/data/ChartListWindowData.ts +++ b/app/src/data/ChartListWindowData.ts @@ -4,6 +4,7 @@ import { Icons } from "../gui/Icons" import { DirectoryWindow } from "../gui/window/DirectoryWindow" import { ActionHistory } from "../util/ActionHistory" import { FileHandler } from "../util/file-handler/FileHandler" +import { dirname } from "../util/Path" import { AUDIO_EXT } from "./FileData" type ChartPropertyEditor = { @@ -109,7 +110,7 @@ export const CHART_PROPERTIES_DATA: { const dirButton = document.createElement("button") dirButton.onclick = () => { - const dir = app.chartManager.smPath.split("/").slice(0, -1).join("/") + const dir = dirname(app.chartManager.smPath) if (window.nw) { const fileSelector = document.createElement("input") fileSelector.type = "file" diff --git a/app/src/data/SMPropertiesData.ts b/app/src/data/SMPropertiesData.ts index ccaf54eb..98b57759 100644 --- a/app/src/data/SMPropertiesData.ts +++ b/app/src/data/SMPropertiesData.ts @@ -5,6 +5,7 @@ import { Icons } from "../gui/Icons" import { NumberSpinner } from "../gui/element/NumberSpinner" import { DirectoryWindow } from "../gui/window/DirectoryWindow" import { ActionHistory } from "../util/ActionHistory" +import { dirname } from "../util/Path" import { FileHandler } from "../util/file-handler/FileHandler" import { AUDIO_EXT, IMG_EXT } from "./FileData" @@ -338,7 +339,7 @@ export function createInputElement( input.onclick = ev => { ev.preventDefault() input.blur() - const dir = app.chartManager.smPath.split("/").slice(0, -1).join("/") + const dir = dirname(app.chartManager.smPath) if (window.nw) { const fileSelector = document.createElement("input") fileSelector.type = "file"