Skip to content

Commit

Permalink
起動時にプロジェクトファイルを読み込む場合に行うエンコード処理の漏れを修正 (#1972)
Browse files Browse the repository at this point in the history
* fix url encode omission when load project files at startup

* change to use URL object when load projectfile at startup
  • Loading branch information
madosuki authored Apr 7, 2024
1 parent 4fbae89 commit 3f19667
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/backend/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ async function createWindow() {
if (isMac) {
if (filePathOnMac) {
if (filePathOnMac.endsWith(".vvproj")) {
projectFilePath = encodeURI(filePathOnMac);
projectFilePath = filePathOnMac;
}
filePathOnMac = undefined;
}
Expand All @@ -408,7 +408,7 @@ async function createWindow() {
fs.statSync(filePath).isFile() &&
filePath.endsWith(".vvproj")
) {
projectFilePath = encodeURI(filePath);
projectFilePath = filePath;
}
}
}
Expand Down Expand Up @@ -469,10 +469,13 @@ async function loadUrl(obj: {
isMultiEngineOffMode?: boolean;
projectFilePath?: string;
}) {
const fragment =
`?isMultiEngineOffMode=${obj?.isMultiEngineOffMode ?? false}` +
`&projectFilePath=${obj?.projectFilePath ?? ""}`;
return win.loadURL(`${firstUrl}${fragment}`);
const url = new URL(firstUrl);
url.searchParams.append(
"isMultiEngineOffMode",
(obj?.isMultiEngineOffMode ?? false).toString()
);
url.searchParams.append("projectFilePath", obj?.projectFilePath ?? "");
return win.loadURL(url.toString());
}

// 開始。その他の準備が完了した後に呼ばれる。
Expand Down

0 comments on commit 3f19667

Please sign in to comment.