Skip to content

Commit

Permalink
add single image strip log event analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
DenDmitriev committed Jun 26, 2024
1 parent 0450e07 commit 7205af2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct ImageSidebarProgressView: View {
}
.onReceive(viewModel.imageRenderService.progress.$current) { current in
withAnimation {
self.current = current
self.current = min(current, total)
}
}
.frame(maxWidth: AppGrid.pt64, maxHeight: AppGrid.pt64)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import SwiftUI
import DominantColors
import FirebaseAnalytics
import FirebaseCrashlytics

class ImageStripViewModel: ObservableObject {
Expand Down Expand Up @@ -44,6 +45,13 @@ class ImageStripViewModel: ObservableObject {
let border = createStripBorder ? stripBorderWidth : nil
let borderColor = createStripBorder ? stripBorderColor.cgColor : nil
imageService.export(imageStrips: [imageStrip], stripHeight: stripImageHeight, colorsCount: colorImageCount, border: border, borderColor: borderColor)
Analytics.logEvent(
AnalyticsEvent.exportImageStrip.key,
parameters: [
"color_count": imageStrip.colors.count,
"border_width": border ?? "Empty"
]
)
}

func prepareDirectory(with result: Result<URL, Error>, for imageStrip: ImageStrip) {
Expand Down

0 comments on commit 7205af2

Please sign in to comment.