Migrate application from js to tsx
Summary: As per the title Reviewed By: jknoxville Differential Revision: D16690005 fbshipit-source-id: 8975da8aa7221b731358eacb4040f48198bf073b
This commit is contained in:
committed by
Facebook Github Bot
parent
03b5b133b8
commit
c3807a6ba2
@@ -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';
|
||||
|
||||
@@ -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<string> => {
|
||||
if (!url) {
|
||||
return [];
|
||||
}
|
||||
const match: ?Array<string> = url.match(
|
||||
const match: Array<string> | undefined | null = url.match(
|
||||
/^flipper:\/\/([^\/]*)\/([^\/]*)\/?(.*)$/,
|
||||
);
|
||||
if (match) {
|
||||
return (match
|
||||
return match
|
||||
.map(decodeURIComponent)
|
||||
.slice(1)
|
||||
.filter(Boolean): Array<string>);
|
||||
.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 &&
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user