Skip to content

Commit

Permalink
add tracking for steps ran and final screenwhen closed
Browse files Browse the repository at this point in the history
Reviewed By: antonk52

Differential Revision: D60231269

fbshipit-source-id: 6c836cfdee746a798484c104d8e03e2c4d5980dd
  • Loading branch information
Luke De Feo authored and facebook-github-bot committed Jul 25, 2024
1 parent c9c0388 commit eca1163
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion desktop/flipper-ui/src/app-connection-updates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import React from 'react';
import {Layout} from './ui';
import {Dialog, getFlipperLib, path} from 'flipper-plugin';
import {getFlipperServer} from './flipperServer';
import {getLogger} from 'flipper-common';

type ConnectionUpdate = {
key: string;
Expand Down Expand Up @@ -195,8 +196,10 @@ export function DIYConnectivityFix({
type="primary"
size="small"
onClick={() => {
const step = os === 'iOS' ? 'ios-idb-kill' : 'android-adb-kill';
logTroubleshootGuideStep(step);
getFlipperServer()
.exec(os === 'iOS' ? 'ios-idb-kill' : 'android-adb-kill')
.exec(step)
.then(() => {
notification.info({
message: `Restarted ${os} connections`,
Expand Down Expand Up @@ -243,6 +246,7 @@ export function DIYConnectivityFix({
),
)
.then(() => {
logTroubleshootGuideStep('delete-certs');
notification.info({
message: `Certificates deleted`,
description: 'Please restart Flipper',
Expand All @@ -265,6 +269,7 @@ export function DIYConnectivityFix({
type="primary"
size="small"
onClick={() => {
logTroubleshootGuideStep('restart-flipper');
getFlipperServer()
.exec('restart')
.then(() => {
Expand Down Expand Up @@ -292,3 +297,9 @@ export function DIYConnectivityFix({
</div>
);
}

export function logTroubleshootGuideStep(step: string) {
getLogger().track('usage', 'troubleshoot-guide-v2-step', {
step,
});
}

0 comments on commit eca1163

Please sign in to comment.