diff --git a/src/chrome/ShareSheet.tsx b/src/chrome/ShareSheet.tsx index 24cdca81f..a4b8d91ba 100644 --- a/src/chrome/ShareSheet.tsx +++ b/src/chrome/ShareSheet.tsx @@ -148,13 +148,15 @@ export default class ShareSheet extends Component { } this.props.logger.trackTimeSince(mark, 'export:url-success'); } catch (e) { - const str = e instanceof Error ? e.toString() : e; - this.setState({ - result: { - error_class: 'EXPORT_ERROR', - error: str, - }, - }); + if (!this.state.runInBackground) { + const str = e instanceof Error ? e.toString() : e; + this.setState({ + result: { + error_class: 'EXPORT_ERROR', + error: str, + }, + }); + } this.props.logger.trackTimeSince(mark, 'export:url-error'); } } diff --git a/src/chrome/ShareSheetExportFile.tsx b/src/chrome/ShareSheetExportFile.tsx index 6f22d35e8..8c91c9e95 100644 --- a/src/chrome/ShareSheetExportFile.tsx +++ b/src/chrome/ShareSheetExportFile.tsx @@ -140,7 +140,9 @@ export default class ShareSheetExportFile extends Component { this.setState({errorArray, result: {success: true, error: null}}); this.props.logger.trackTimeSince(mark, 'export:file-success'); } catch (err) { - this.setState({errorArray: [], result: {success: false, error: err}}); + if (!this.state.runInBackground) { + this.setState({errorArray: [], result: {success: false, error: err}}); + } this.props.logger.trackTimeSince(mark, 'export:file-error'); } }