add logging

This commit is contained in:
Trey t
2022-03-13 20:06:26 -05:00
parent 8d3e9a7c6e
commit f3542117a7
14 changed files with 93 additions and 5 deletions

View File

@@ -61,6 +61,9 @@ struct CustomizeView: View {
pickPeronsalityPack
}
}
.onAppear(perform: {
EventLogger.log(event: "show_customize_view")
})
.padding()
.sheet(isPresented: $selectedWidget.showFuckingSheet) {
if let fuckingWrapped = selectedWidget.fuckingWrapped {
@@ -81,6 +84,7 @@ struct CustomizeView: View {
HStack {
Button(action: {
UIApplication.shared.setAlternateIconName(nil)
EventLogger.log(event: "change_icon_title", withData: ["title": "default"])
}, label: {
Image("AppIconImage", bundle: .main)
.resizable()
@@ -94,6 +98,7 @@ struct CustomizeView: View {
UIApplication.shared.setAlternateIconName(iconSet.1) { (error) in
// FIXME: Handle error
}
EventLogger.log(event: "change_icon_title", withData: ["title": iconSet.1])
}, label: {
Image(iconSet.0, bundle: .main)
.resizable()
@@ -122,6 +127,7 @@ struct CustomizeView: View {
ForEach(Theme.allCases, id:\.rawValue) { aTheme in
Button(action: {
theme = aTheme
EventLogger.log(event: "change_theme_id", withData: ["id": aTheme.rawValue])
}, label: {
VStack {
aTheme.currentTheme.preview
@@ -163,6 +169,7 @@ struct CustomizeView: View {
.frame(width: 50, height: 50)
.cornerRadius(10)
.onTapGesture {
EventLogger.log(event: "show_widget")
selectedWidget.fuckingWrapped = widget.copy() as? CustomWidgetModel
selectedWidget.showFuckingSheet = true
}
@@ -173,6 +180,7 @@ struct CustomizeView: View {
Image(systemName: "plus")
)
.onTapGesture {
EventLogger.log(event: "tap_create_new_widget")
selectedWidget.fuckingWrapped = CustomWidgetModel.randomWidget
selectedWidget.showFuckingSheet = true
}
@@ -221,6 +229,7 @@ struct CustomizeView: View {
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
impactMed.impactOccurred()
imagePack = images
EventLogger.log(event: "change_image_pack_id", withData: ["id": images.rawValue])
}
if images.rawValue != (MoodImages.allCases.sorted(by: { $0.rawValue > $1.rawValue }).first?.rawValue) ?? 0 {
Divider()
@@ -261,6 +270,7 @@ struct CustomizeView: View {
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
impactMed.impactOccurred()
moodTint = tint
EventLogger.log(event: "change_mood_tint_id", withData: ["id": tint.rawValue])
}
Divider()
}
@@ -376,6 +386,7 @@ struct CustomizeView: View {
private func saveCustomMoodTint() {
UserDefaultsStore.saveCustomMoodTint(customTint: customMoodTint)
moodTint = .Custom
EventLogger.log(event: "change_mood_tint_id", withData: ["id": MoodTints.Custom.rawValue])
customMoodTintUpdateNumber += 1
}
@@ -407,10 +418,12 @@ struct CustomizeView: View {
.onTapGesture {
if aPack.rawValue == PersonalityPack.Rude.rawValue && !showNSFW {
showOver18Alert = true
EventLogger.log(event: "show_over_18_alert")
} else {
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
impactMed.impactOccurred()
personalityPack = aPack
EventLogger.log(event: "change_personality_pack", withData: ["pack_title": aPack.title()])
LocalNotification.rescheduleNotifiations()
}
}