Skip to content

Commit

Permalink
Merge pull request #17523 from wordpress-mobile/issue/17503-reduce-im…
Browse files Browse the repository at this point in the history
…age-size-tracking

Prevents the image size change from tracking each value continuously
  • Loading branch information
Emily Laguna authored Nov 23, 2021
2 parents 41f358a + d46b2e2 commit 4f7f910
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,20 @@ class AppSettingsViewController: UITableViewController {
MediaSettings().maxImageSizeSetting = value
ShareExtensionService.configureShareExtensionMaximumMediaDimension(value)

var properties = [String: AnyObject]()
properties["enabled"] = (value != Int.max) as AnyObject
properties["value"] = value as Int as AnyObject
WPAnalytics.track(.appSettingsImageOptimizationChanged, withProperties: properties)
self.debounce(#selector(self.trackImageSizeChanged), afterDelay: 0.5)
}
}

@objc func trackImageSizeChanged() {
let value = MediaSettings().maxImageSizeSetting

var properties = [String: AnyObject]()
properties["enabled"] = (value != Int.max) as AnyObject
properties["value"] = value as Int as AnyObject

WPAnalytics.track(.appSettingsImageOptimizationChanged, withProperties: properties)
}

func pushVideoResolutionSettings() -> ImmuTableAction {
return { [weak self] row in
let values = [MediaSettings.VideoResolution.size640x480,
Expand Down

0 comments on commit 4f7f910

Please sign in to comment.