Skip to content

Commit a7cfc03

Browse files
Rename api
1 parent 6bbe1b2 commit a7cfc03

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/components/intercept/config/electron-config.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function getReadablePath(path: string) {
123123

124124
declare global {
125125
interface Window {
126-
nativeFile?: { open: () => Promise<string | undefined> };
126+
desktopApi?: { selectApplication: () => Promise<string | undefined> };
127127
}
128128
}
129129

@@ -149,11 +149,13 @@ class ElectronConfig extends React.Component<{
149149

150150
selectApplication = async () => {
151151
const useNativePicker =
152-
platform == 'mac' && window.nativeFile?.open;
152+
platform == 'mac' && window.desktopApi?.selectApplication;
153153

154-
const pathToApplication = await (useNativePicker
155-
? window.nativeFile?.open()
156-
: uploadFile('path'));
154+
const pathToApplication = await(
155+
useNativePicker
156+
? window.desktopApi?.selectApplication()
157+
: uploadFile('path')
158+
);
157159

158160
if (!pathToApplication) {
159161
this.props.closeSelf();

0 commit comments

Comments
 (0)