diff --git a/src/dispatcher/application.tsx b/src/dispatcher/application.tsx index c10705bd3..5c8fa5199 100644 --- a/src/dispatcher/application.tsx +++ b/src/dispatcher/application.tsx @@ -51,39 +51,42 @@ export default (store: Store, logger: Logger) => { }); }); - ipcRenderer.on('flipper-protocol-handler', (event, query: string) => { - if (query.startsWith('flipper://import')) { - const {search} = new URL(query); - const {url} = qs.parse(search); - store.dispatch(toggleAction('downloadingImportData', true)); - return ( - typeof url === 'string' && - fetch(url) - .then(res => res.text()) - .then(data => importDataToStore(data, store)) - .then(() => { - store.dispatch(toggleAction('downloadingImportData', false)); - }) - .catch((e: Error) => { - console.error(e); - store.dispatch(toggleAction('downloadingImportData', false)); - }) - ); - } - const match = uriComponents(query); - if (match.length > 1) { - // flipper://// - return store.dispatch( - selectPlugin({ - selectedApp: match[0], - selectedPlugin: match[1], - deepLinkPayload: match[2], - }), - ); - } - }); + ipcRenderer.on( + 'flipper-protocol-handler', + (_event: string, query: string) => { + if (query.startsWith('flipper://import')) { + const {search} = new URL(query); + const {url} = qs.parse(search); + store.dispatch(toggleAction('downloadingImportData', true)); + return ( + typeof url === 'string' && + fetch(url) + .then(res => res.text()) + .then(data => importDataToStore(data, store)) + .then(() => { + store.dispatch(toggleAction('downloadingImportData', false)); + }) + .catch((e: Error) => { + console.error(e); + store.dispatch(toggleAction('downloadingImportData', false)); + }) + ); + } + const match = uriComponents(query); + if (match.length > 1) { + // flipper://// + return store.dispatch( + selectPlugin({ + selectedApp: match[0], + selectedPlugin: match[1], + deepLinkPayload: match[2], + }), + ); + } + }, + ); - ipcRenderer.on('open-flipper-file', (event, url) => { + ipcRenderer.on('open-flipper-file', (_event: string, url: string) => { tryCatchReportPlatformFailures(() => { return importFileToStore(url, store); }, `${IMPORT_FLIPPER_TRACE_EVENT}:Deeplink`);