Просмотр исходного кода

add quote for consistency, renamed method

Kyle McWhirter 2 лет назад
Родитель
Сommit
19490ec164
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      FreeAPS/Sources/Shortcuts/TempPresets/ApplyTempPresetIntent.swift

+ 3 - 3
FreeAPS/Sources/Shortcuts/TempPresets/ApplyTempPresetIntent.swift

@@ -34,7 +34,7 @@ import Foundation
         })
     }
 
-    private func decimalToTimeString(decimal: Decimal) -> String {
+    private func decimalToTimeFormattedString(decimal: Decimal) -> String {
         let timeInterval = TimeInterval(decimal * 60) // seconds
 
         let formatter = DateComponentsFormatter()
@@ -59,14 +59,14 @@ import Foundation
             let displayName: String = presetToApply.name
             if confirmBeforeApplying {
                 try await requestConfirmation(
-                    result: .result(dialog: "Confirm to apply temporary target \(displayName)")
+                    result: .result(dialog: "Confirm to apply temporary target '\(displayName)'")
                 )
             }
 
             // TODO: enact the temp target
             let tempTarget = try intentRequest.findTempTarget(presetToApply)
             let finalTempTargetApply = try intentRequest.enactTempTarget(tempTarget)
-            let formattedTime = decimalToTimeString(decimal: finalTempTargetApply.duration)
+            let formattedTime = decimalToTimeFormattedString(decimal: finalTempTargetApply.duration)
             let displayDetail: String =
                 "Target '\(finalTempTargetApply.displayName)' applied for \(formattedTime)"
             return .result(