mirror of
https://github.com/kean/Pulse.git
synced 2026-05-30 21:07:33 +00:00
Fix warnings on watchOS
This commit is contained in:
@@ -67,11 +67,11 @@ enum ConsoleFormatter {
|
||||
return label.capitalized
|
||||
}
|
||||
|
||||
static func subheadline(for task: NetworkTaskEntity, hasTime: Bool = true) -> String {
|
||||
static func subheadline(for task: NetworkTaskEntity, hasTime: Bool = true, store: LoggerStore) -> String {
|
||||
return [
|
||||
hasTime ? time(for: task.createdAt) : nil,
|
||||
task.httpMethod ?? "GET",
|
||||
status(for: task),
|
||||
status(for: task, store: store),
|
||||
transferSize(for: task),
|
||||
duration(for: task)
|
||||
].compactMap { $0 }.joined(separator: separator)
|
||||
@@ -99,9 +99,11 @@ enum ConsoleFormatter {
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, deprecated, renamed: "Ds", message: "ds")
|
||||
static func status(for task: NetworkTaskEntity) -> String {
|
||||
switch task.state {
|
||||
static func status(for task: NetworkTaskEntity, store: LoggerStore) -> String {
|
||||
guard let state = task.state(in: store) else {
|
||||
return "Unknown"
|
||||
}
|
||||
switch state {
|
||||
case .pending:
|
||||
return ProgressViewModel.title(for: task)
|
||||
case .success:
|
||||
|
||||
@@ -90,7 +90,7 @@ final class TextRenderer {
|
||||
if content.contains(.largeHeader) {
|
||||
renderLargeHeader(for: task, store: store)
|
||||
} else if content.contains(.header) {
|
||||
renderHeader(for: task)
|
||||
renderHeader(for: task, store: store)
|
||||
}
|
||||
|
||||
if content.contains(.taskDetails) {
|
||||
@@ -171,11 +171,11 @@ final class TextRenderer {
|
||||
addSpacer()
|
||||
}
|
||||
|
||||
private func renderHeader(for task: NetworkTaskEntity) {
|
||||
private func renderHeader(for task: NetworkTaskEntity, store: LoggerStore) {
|
||||
let isTitleColored = task.state == .failure && options.color != .monochrome
|
||||
let titleColor = isTitleColored ? UXColor.systemRed : UXColor.secondaryLabel
|
||||
let detailsColor = isTitleColored ? UXColor.systemRed : UXColor.label
|
||||
let title = ConsoleFormatter.subheadline(for: task)
|
||||
let title = ConsoleFormatter.subheadline(for: task, store: store)
|
||||
string.append(title + "\n", helper.attributes(role: .subheadline, style: .monospacedDigital, width: .condensed, color: titleColor))
|
||||
var urlAttributes = helper.attributes(role: .body2, weight: .medium, color: detailsColor)
|
||||
urlAttributes[.underlineColor] = UXColor.clear
|
||||
|
||||
Reference in New Issue
Block a user