Browse Source

Sending date when feedback is sent for better triaging.

pull/92/head
Abhishek Banthia 6 years ago
parent
commit
280f48647d
  1. 11
      Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift

11
Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift

@ -22,6 +22,8 @@ struct AppFeedbackConstants {
static let CLFeedbackAlertInformativeText = "We owe you a candy. 😇"
static let CLFeedbackAlertButtonTitle = "Close"
static let CLFeedbackNotEnteredErrorMessage = "Please enter some feedback."
static let CLAppFeedbackDateProperty = "date"
static let CLCaliforniaTimezoneIdentifier = "America/Los_Angeles"
}
class AppFeedbackWindowController: NSWindowController {
@ -156,11 +158,20 @@ class AppFeedbackWindowController: NSWindowController {
AppFeedbackConstants.CLAppFeedbackFeedbackProperty: appFeedbackProperty,
AppFeedbackConstants.CLOperatingSystemVersion: osVersion,
AppFeedbackConstants.CLClockerVersion: versionInfo,
AppFeedbackConstants.CLAppFeedbackDateProperty: todaysDate(),
]
return feedbackInfo
}
private func todaysDate() -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .medium
dateFormatter.timeStyle = .short
dateFormatter.timeZone = TimeZone(identifier: AppFeedbackConstants.CLCaliforniaTimezoneIdentifier)
return dateFormatter.string(from: Date())
}
private func sendDataToFirebase(feedbackInfo: [String: String]) {
guard let identifier = serialNumber else {
assertionFailure("Serial Identifier was unexpectedly nil")

Loading…
Cancel
Save