mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[feat-75] fix paths of dropped zips are undefined
This commit is contained in:
+4
-1
@@ -1,4 +1,4 @@
|
||||
import { contextBridge, ipcRenderer, IpcRendererEvent } from "electron";
|
||||
import { contextBridge, ipcRenderer, IpcRendererEvent, webUtils } from "electron";
|
||||
import { ProviderPlatform } from "shared/models/provider-platform.enum";
|
||||
|
||||
const sep = process.platform === ProviderPlatform.WINDOWS ? "\\" : "/";
|
||||
@@ -30,5 +30,8 @@ contextBridge.exposeInMainWorld("electron", {
|
||||
join: (...args: string[]): string => {
|
||||
return args.join(sep);
|
||||
}
|
||||
},
|
||||
webUtils: {
|
||||
getPathForFile: webUtils.getPathForFile
|
||||
}
|
||||
});
|
||||
|
||||
@@ -110,7 +110,7 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
|
||||
for (let i = 0; i < files.length; ++i) {
|
||||
const file = files[i];
|
||||
if (zipMimeTypes.includes(file.type)) {
|
||||
paths.push(file.path);
|
||||
paths.push(window.electron.webUtils.getPathForFile(file));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+5
@@ -1,3 +1,5 @@
|
||||
import { webUtils } from "electron";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
electron: {
|
||||
@@ -13,6 +15,9 @@ declare global {
|
||||
basename: (path: string) => string;
|
||||
join: (...args: string[]) => string;
|
||||
};
|
||||
webUtils: {
|
||||
getPathForFile: typeof webUtils.getPathForFile;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user