From e1e8760f1231a7c4c9bd6db50099d0db71e22c99 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Tue, 17 Sep 2019 04:10:36 -0700 Subject: [PATCH] Show the status message of uploading Flipper trace Summary: This diff shows the status message of "Uploading Flipper Trace..." when we upload it. Reviewed By: danielbuechele Differential Revision: D17402445 fbshipit-source-id: ab2927de34ab5d7e49e7c7ea005d40816a0365bd --- src/chrome/ShareSheet.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/chrome/ShareSheet.tsx b/src/chrome/ShareSheet.tsx index 88d6213dd..04116e6be 100644 --- a/src/chrome/ShareSheet.tsx +++ b/src/chrome/ShareSheet.tsx @@ -115,19 +115,20 @@ export default class ShareSheet extends Component { const mark = 'shareSheetExportUrl'; performance.mark(mark); try { + const statusUpdate = (msg: string) => { + if (this.state.runInBackground) { + this.dispatchAndUpdateToolBarStatus(msg); + } else { + this.setState({statusUpdate: msg}); + } + }; const {serializedString, errorArray} = await reportPlatformFailures( - exportStore(this.context.store, this.idler, (msg: string) => { - if (this.state.runInBackground) { - this.dispatchAndUpdateToolBarStatus(msg); - } else { - this.setState({statusUpdate: msg}); - } - }), + exportStore(this.context.store, this.idler, statusUpdate), `${EXPORT_FLIPPER_TRACE_EVENT}:UI_LINK`, ); this.context.store.dispatch(unsetShare()); - + statusUpdate('Uploading Flipper Trace...'); const result = await reportPlatformFailures( shareFlipperData(serializedString), `${SHARE_FLIPPER_TRACE_EVENT}`,