Fix Analytics
Summary: We were missing to log for those cases when we exported through sharable link. Also I changed logging a bit so that we can differentiate between Sharable Link and File exports Reviewed By: jknoxville Differential Revision: D15080292 fbshipit-source-id: 063e9f515e4f089ed3715e7b1ca0e66410e46541
This commit is contained in:
committed by
Facebook Github Bot
parent
afd729deb6
commit
2359d22b46
@@ -18,9 +18,11 @@ import {
|
|||||||
Input,
|
Input,
|
||||||
} from 'flipper';
|
} from 'flipper';
|
||||||
import {shareFlipperData} from '../fb-stubs/user';
|
import {shareFlipperData} from '../fb-stubs/user';
|
||||||
import {exportStore} from '../utils/exportData.js';
|
import {exportStore, EXPORT_FLIPPER_TRACE_EVENT} from '../utils/exportData.js';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import {clipboard} from 'electron';
|
import {clipboard} from 'electron';
|
||||||
|
import {reportPlatformFailures} from '../utils/metrics';
|
||||||
|
export const SHARE_FLIPPER_TRACE_EVENT = 'share-flipper-link';
|
||||||
|
|
||||||
const Container = styled(FlexColumn)({
|
const Container = styled(FlexColumn)({
|
||||||
padding: 20,
|
padding: 20,
|
||||||
@@ -95,10 +97,16 @@ export default class ShareSheet extends Component<Props, State> {
|
|||||||
|
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
try {
|
try {
|
||||||
const {serializedString, errorArray} = await exportStore(
|
const {serializedString, errorArray} = await reportPlatformFailures(
|
||||||
this.context.store,
|
exportStore(this.context.store),
|
||||||
|
`${EXPORT_FLIPPER_TRACE_EVENT}:UI_LINK`,
|
||||||
);
|
);
|
||||||
const result = await shareFlipperData(serializedString);
|
|
||||||
|
const result = await reportPlatformFailures(
|
||||||
|
shareFlipperData(serializedString),
|
||||||
|
`${SHARE_FLIPPER_TRACE_EVENT}`,
|
||||||
|
);
|
||||||
|
|
||||||
this.setState({errorArray, result});
|
this.setState({errorArray, result});
|
||||||
if (result.flipperUrl) {
|
if (result.flipperUrl) {
|
||||||
clipboard.writeText(String(result.flipperUrl));
|
clipboard.writeText(String(result.flipperUrl));
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export default class ShareSheetExportFile extends Component<Props, State> {
|
|||||||
try {
|
try {
|
||||||
const {errorArray} = await reportPlatformFailures(
|
const {errorArray} = await reportPlatformFailures(
|
||||||
exportStoreToFile(this.props.file, this.context.store),
|
exportStoreToFile(this.props.file, this.context.store),
|
||||||
`${EXPORT_FLIPPER_TRACE_EVENT}:UI`,
|
`${EXPORT_FLIPPER_TRACE_EVENT}:UI_FILE`,
|
||||||
);
|
);
|
||||||
this.setState({errorArray, result: {success: true, error: null}});
|
this.setState({errorArray, result: {success: true, error: null}});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user