diff --git a/desktop/app/src/deeplink.tsx b/desktop/app/src/deeplink.tsx index 6f742bd64..de78280d1 100644 --- a/desktop/app/src/deeplink.tsx +++ b/desktop/app/src/deeplink.tsx @@ -11,7 +11,6 @@ import { ACTIVE_SHEET_SIGN_IN, setActiveSheet, setPastedToken, - toggleAction, } from './reducers/application'; import {Group, SUPPORTED_GROUPS} from './reducers/supportForm'; import {Store} from './reducers/index'; @@ -19,6 +18,7 @@ import {importDataToStore} from './utils/exportData'; import {selectPlugin} from './reducers/connections'; import {Dialog} from 'flipper-plugin'; import {handleOpenPluginDeeplink} from './dispatcher/handleOpenPluginDeeplink'; +import {message} from 'antd'; const UNKNOWN = 'Unknown deeplink'; /** @@ -37,18 +37,22 @@ export async function handleDeeplink( } if (uri.pathname.match(/^\/*import\/*$/)) { const url = uri.searchParams.get('url'); - store.dispatch(toggleAction('downloadingImportData', true)); if (url) { + const handle = Dialog.loading({ + message: 'Importing Flipper trace...', + }); return fetch(url) .then((res) => res.text()) .then((data) => importDataToStore(url, data, store)) - .then(() => { - store.dispatch(toggleAction('downloadingImportData', false)); - }) .catch((e: Error) => { - console.error('Failed to download Flipper trace' + e); - store.dispatch(toggleAction('downloadingImportData', false)); - throw e; + console.warn('Failed to download Flipper trace', e); + message.error({ + duration: null, + content: 'Failed to download Flipper trace: ' + e, + }); + }) + .finally(() => { + handle.close(); }); } throw new Error(UNKNOWN); diff --git a/desktop/app/src/reducers/application.tsx b/desktop/app/src/reducers/application.tsx index 229e238fb..e5fa1c83e 100644 --- a/desktop/app/src/reducers/application.tsx +++ b/desktop/app/src/reducers/application.tsx @@ -84,7 +84,6 @@ export type State = { share: ShareType | null; sessionId: string | null; serverPorts: ServerPorts; - downloadingImportData: boolean; launcherMsg: LauncherMsg; statusMessages: Array; xcodeCommandLineToolsDetected: boolean; @@ -94,8 +93,7 @@ export type State = { type BooleanActionType = | 'leftSidebarVisible' | 'rightSidebarVisible' - | 'rightSidebarAvailable' - | 'downloadingImportData'; + | 'rightSidebarAvailable'; export type Action = | { @@ -174,7 +172,6 @@ export const initialState: () => State = () => ({ insecure: 8089, secure: 8088, }, - downloadingImportData: false, launcherMsg: { severity: 'warning', message: '', @@ -203,8 +200,7 @@ export default function reducer( if ( action.type === 'leftSidebarVisible' || action.type === 'rightSidebarVisible' || - action.type === 'rightSidebarAvailable' || - action.type === 'downloadingImportData' + action.type === 'rightSidebarAvailable' ) { const newValue = typeof action.payload === 'undefined'