Skip to content

Commit

Permalink
Fix: win path bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffreyChen777 committed Jun 29, 2022
1 parent fe7e1ee commit a754051
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions packages/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ ipcMain.on("maximize", () => {
ipcMain.on("close", () => {
win?.close();
winPlugin?.close();
winCheck?.close();
// app.quit();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,13 @@ export class WebDavFileBackend implements FileBackend {
"webdav://"
);
} else {
sourceMainURL = constructFileURL(entity.mainURL, false, true, "file://");
sourceMainURL = constructFileURL(
entity.mainURL,
false,
true,
"",
"file://"
);
}
const targetMainURL = constructFileURL(
targetFileName + "_main" + path.extname(sourceMainURL),
Expand Down
16 changes: 6 additions & 10 deletions packages/preload/utils/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,14 @@ export const constructFileURL = (
}
}

if (os.platform().startsWith("win")) {
return outURL;
} else {
if (withProtocol) {
if (outURL.startsWith(protocol)) {
return outURL;
} else {
return protocol + outURL;
}
if (withProtocol) {
if (outURL.startsWith(protocol)) {
return outURL;
} else {
return outURL.replace(protocol, "");
return protocol + outURL;
}
} else {
return outURL.replace(protocol, "");
}
};

Expand Down

0 comments on commit a754051

Please sign in to comment.