Skip to content

Commit

Permalink
fire pixel on pull to reload
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Jan 18, 2024
1 parent 614bc47 commit 84e7812
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ extension Pixel {

case appLaunch
case refreshPressed
case pullToRefresh

case forgetAllPressedBrowsing
case forgetAllPressedTabSwitching
Expand Down Expand Up @@ -523,7 +524,8 @@ extension Pixel.Event {
switch self {
case .appLaunch: return "ml"
case .refreshPressed: return "m_r"

case .pullToRefresh: return "m_pull-to-reload"

case .forgetAllPressedBrowsing: return "mf_bp"
case .forgetAllPressedTabSwitching: return "mf_tp"
case .forgetAllExecuted: return "mf"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
{
"identity" : "trackerradarkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/TrackerRadarKit",
"location" : "https://github.com/duckduckgo/TrackerRadarKit.git",
"state" : {
"revision" : "a6b7ba151d9dc6684484f3785293875ec01cc1ff",
"version" : "1.2.2"
Expand Down
4 changes: 3 additions & 1 deletion DuckDuckGo/TabViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ class TabViewController: UIViewController {
webViewContainer.addSubview(webView)
webView.scrollView.refreshControl = UIRefreshControl()
webView.scrollView.refreshControl?.addAction(UIAction { [weak self] _ in
self?.reload()
guard let self else { return }
self.reload()
Pixel.fire(pixel: .pullToRefresh)
}, for: .valueChanged)

webView.scrollView.refreshControl?.backgroundColor = .systemBackground
Expand Down

0 comments on commit 84e7812

Please sign in to comment.