Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into pr/130
  • Loading branch information
PaulGoldschmidt committed Feb 17, 2025
2 parents 33abce6 + 18caaff commit 69540f6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
30 changes: 15 additions & 15 deletions ENGAGEHF/Dashboard/Messages/MessageRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ struct MessageRow: View {
.font(.caption)
.foregroundStyle(.secondary)
}
.padding(.vertical, 4)
.padding(.horizontal, 8)
.background {
Capsule()
.fill(.secondary.opacity(0.1))
}
.padding(.vertical, 4)
.padding(.horizontal, 8)
.background {
Capsule()
.fill(.secondary.opacity(0.1))
}
}

private var processingStateText: String {
Expand Down Expand Up @@ -138,18 +138,18 @@ struct MessageRow: View {
.frame(width: 38)
mainContent
}
.padding(2)
.asButton {
if message.action != .unknown && !message.isProcessing {
Task {
let didPerformAction = await navigationManager.execute(message.action)
if message.isDismissible, didPerformAction {
await messageManager.dismiss(message, didPerformAction: didPerformAction)
.padding(2)
.asButton {
if message.action != .unknown && !message.isProcessing {
Task {
let didPerformAction = await navigationManager.execute(message.action)
if message.isDismissible, didPerformAction {
await messageManager.dismiss(message, didPerformAction: didPerformAction)
}
}
}
}
}
.disabled(message.isProcessing)
.disabled(message.isProcessing)
}
}

Expand Down
5 changes: 1 addition & 4 deletions ENGAGEHF/Managers/MessageManager/Message.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ struct Message: Identifiable, Equatable {
var processingState: ProcessingState?

var isProcessing: Bool {
guard let processingState else {
return false
}
return processingState.isStillProcessing
processingState.isStillProcessing ?? false
}

func isRelatedTo(_ state: ProcessingState) -> Bool {

Check failure on line 32 in ENGAGEHF/Managers/MessageManager/Message.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint

Type Contents Order Violation: An 'other_method' should not be placed amongst the type content(s) 'initializer' (type_contents_order)
Expand Down
2 changes: 1 addition & 1 deletion ENGAGEHF/Managers/MessageManager/ProcessingState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ struct ProcessingState: Equatable {
let correlationId: String

var isStillProcessing: Bool {
Date().timeIntervalSince(startTime) < 60
.now.timeIntervalSince(startTime) < 60
}
}

0 comments on commit 69540f6

Please sign in to comment.