File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
components/intercept/config Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,12 @@ function getReadablePath(path: string) {
121121 }
122122}
123123
124+ declare global {
125+ interface Window {
126+ nativeFile : { open : ( ) => Promise < string | undefined > } ;
127+ }
128+ }
129+
124130@inject ( 'uiStore' )
125131@observer
126132class ElectronConfig extends React . Component < {
@@ -142,7 +148,12 @@ class ElectronConfig extends React.Component<{
142148 }
143149
144150 selectApplication = async ( ) => {
145- const pathToApplication = await uploadFile ( 'path' ) ;
151+ const useNativePicker =
152+ platform == 'win' && window . nativeFile . open ;
153+
154+ const pathToApplication = await ( useNativePicker
155+ ? window . nativeFile . open ( )
156+ : uploadFile ( 'path' ) ) ;
146157
147158 if ( ! pathToApplication ) {
148159 this . props . closeSelf ( ) ;
@@ -220,4 +231,4 @@ export const ElectronCustomUi = {
220231 columnWidth : 1 ,
221232 rowHeight : 2 ,
222233 configComponent : ElectronConfig
223- } ;
234+ } ;
Original file line number Diff line number Diff line change @@ -284,10 +284,6 @@ const INTERCEPT_OPTIONS: _.Dictionary<InterceptorConfig> = {
284284 description : [ "Launch an Electron application with all its traffic intercepted" ] ,
285285 iconProps : SourceIcons . Electron ,
286286 uiConfig : ElectronCustomUi ,
287- checkRequirements : ( { interceptorVersion } ) => {
288- return ! navigator . platform . startsWith ( 'Mac' ) &&
289- versionSatisfies ( interceptorVersion , "^1.0.1" )
290- } ,
291287 tags : [ 'electron' , 'desktop' , 'postman' ]
292288 } ,
293289 [ MANUAL_INTERCEPT_ID ] : {
@@ -359,4 +355,4 @@ export function getInterceptOptions(
359355 } ) ;
360356 }
361357 } ) ;
362- }
358+ }
You can’t perform that action at this time.
0 commit comments