Migrate metrics

Summary:
Had to mess with the tagged union we had, to distinguish based on
a string rather a bool which is a bit rubbish.

Reviewed By: danielbuechele

Differential Revision: D16764797

fbshipit-source-id: c33536f17b0705ca40abef8448802f9961c4c114
This commit is contained in:
Pascal Hartig
2019-08-14 04:36:51 -07:00
committed by Facebook Github Bot
parent 46e0abecdf
commit 2a34125413
3 changed files with 40 additions and 39 deletions

View File

@@ -20,7 +20,7 @@ import React, {Component} from 'react';
import {setExportStatusComponent, unsetShare} from '../reducers/application';
import {Logger} from '../fb-interfaces/Logger.js';
import {Idler} from '../utils/Idler';
import {shareFlipperData} from '../fb-stubs/user';
import {shareFlipperData, DataExportResult} from '../fb-stubs/user';
import {exportStore, EXPORT_FLIPPER_TRACE_EVENT} from '../utils/exportData';
import PropTypes from 'prop-types';
import {clipboard} from 'electron';
@@ -139,8 +139,8 @@ export default class ShareSheet extends Component<Props, State> {
);
this.setState({errorArray, result});
if (result.flipperUrl) {
clipboard.writeText(String(result.flipperUrl));
if ((result as DataExportResult).flipperUrl) {
clipboard.writeText(String((result as DataExportResult).flipperUrl));
new Notification('Sharable Flipper trace created', {
body: 'URL copied to clipboard',
requireInteraction: true,