Skip to content

Commit ff51519

Browse files
committed
Add events for reconnect/try-again/docs buttons
1 parent 9a0a830 commit ff51519

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/java/tech/httptoolkit/android/MainActivity.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {
307307
}
308308

309309
private suspend fun reconnect(lastProxy: ProxyConfig) {
310+
app.trackEvent("Button", "reconnect")
310311
try {
311312
// Revalidates the config, to ensure the server is available (and drop retries if not)
312313
val config = getProxyConfig(
@@ -332,12 +333,14 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {
332333
}
333334

334335
private fun resetAfterFailure() {
336+
app.trackEvent("Button", "try-again")
335337
currentProxyConfig = null
336338
mainState = MainState.DISCONNECTED
337339
updateUi()
338340
}
339341

340342
private fun openDocs() {
343+
app.trackEvent("Button", "open-docs")
341344
val browserIntent = Intent(Intent.ACTION_VIEW,
342345
Uri.parse("https://httptoolkit.tech/docs/guides/android")
343346
)

0 commit comments

Comments
 (0)