2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

For #2362: Fixes telemetry for history (#4156)

This commit is contained in:
Sawyer Blatz 2019-07-18 13:36:52 -07:00 committed by Jeff Boek
parent 981b6b5b02
commit 9251597e84

View File

@ -89,6 +89,7 @@ class HistoryFragment : Fragment(), BackHandler {
lifecycleScope.launch {
val storage = context?.components?.core?.historyStorage
for (item in items) {
context?.components?.analytics?.metrics?.track(Event.HistoryItemRemoved)
storage?.deleteVisit(item.url, item.visitedAt)
}
reloadData()
@ -173,6 +174,7 @@ class HistoryFragment : Fragment(), BackHandler {
(historyStore.state.mode as? HistoryState.Mode.Editing)?.selectedItems ?: listOf()
requireComponents.useCases.tabsUseCases.addTab.let { useCase ->
for (selectedItem in selectedHistory) {
requireComponents.analytics.metrics.track(Event.HistoryItemOpened)
useCase.invoke(selectedItem.url)
}
}
@ -192,6 +194,7 @@ class HistoryFragment : Fragment(), BackHandler {
(historyStore.state.mode as? HistoryState.Mode.Editing)?.selectedItems ?: listOf()
requireComponents.useCases.tabsUseCases.addPrivateTab.let { useCase ->
for (selectedItem in selectedHistory) {
requireComponents.analytics.metrics.track(Event.HistoryItemOpened)
useCase.invoke(selectedItem.url)
}
}