diff --git a/src/dispatcher/__tests__/deeplinkURLParsing.node.js b/src/dispatcher/__tests__/deeplinkURLParsing.node.js index 6746a792b..6ec32161c 100644 --- a/src/dispatcher/__tests__/deeplinkURLParsing.node.js +++ b/src/dispatcher/__tests__/deeplinkURLParsing.node.js @@ -5,7 +5,7 @@ * @format */ -import {uriComponents} from '../application.js'; +import {uriComponents} from '../application.tsx'; test('test parsing of deeplink URL', () => { const url = 'flipper://app/plugin/meta/data'; diff --git a/src/dispatcher/application.js b/src/dispatcher/application.tsx similarity index 85% rename from src/dispatcher/application.js rename to src/dispatcher/application.tsx index dbc6aebca..1fb1bc6c4 100644 --- a/src/dispatcher/application.js +++ b/src/dispatcher/application.tsx @@ -6,9 +6,9 @@ */ import {remote, ipcRenderer} from 'electron'; -import type {Store} from '../reducers/index.tsx'; -import type {Logger} from '../fb-interfaces/Logger.js'; -import {toggleAction} from '../reducers/application.tsx'; +import {toggleAction} from '../reducers/application'; +import {Store} from '../reducers/index.js'; +import {Logger} from '../fb-interfaces/Logger.js'; import {parseFlipperPorts} from '../utils/environmentVariables'; import { importDataToStore, @@ -17,21 +17,21 @@ import { } from '../utils/exportData'; import {tryCatchReportPlatformFailures} from '../utils/metrics'; -import {selectPlugin} from '../reducers/connections.tsx'; +import {selectPlugin} from '../reducers/connections'; import qs from 'query-string'; -export const uriComponents = (url: string) => { +export const uriComponents = (url: string): Array => { if (!url) { return []; } - const match: ?Array = url.match( + const match: Array | undefined | null = url.match( /^flipper:\/\/([^\/]*)\/([^\/]*)\/?(.*)$/, ); if (match) { - return (match + return match .map(decodeURIComponent) .slice(1) - .filter(Boolean): Array); + .filter(Boolean); } return []; }; @@ -54,7 +54,7 @@ export default (store: Store, logger: Logger) => { ipcRenderer.on('flipper-protocol-handler', (event, url) => { if (url.startsWith('flipper://import')) { const {search} = new URL(url); - const download = qs.parse(search)?.url; + const download = qs.parse(search) ? qs.parse(search) : undefined; store.dispatch(toggleAction('downloadingImportData', true)); return ( download && diff --git a/src/dispatcher/index.js b/src/dispatcher/index.js index 3d1fb5c82..1ed385007 100644 --- a/src/dispatcher/index.js +++ b/src/dispatcher/index.js @@ -8,7 +8,7 @@ import androidDevice from './androidDevice.tsx'; import iOSDevice from './iOSDevice'; import desktopDevice from './desktopDevice'; -import application from './application'; +import application from './application.tsx'; import tracking from './tracking.tsx'; import server from './server.tsx'; import notifications from './notifications';