mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-05 10:29:58 +02:00
fix(apple): treat a completed receiver event as terminal
progressForReceiver only labelled a receiver Completed when no progress/started events preceded the completion, so the normal progress→completed sequence fell through and rendered as Sending despite a .completed kind. Events are newest-first, so a completed latest event is always terminal — label it Completed. Fixes the failing ProgressDerivationTests.testReceiverCompletionAfterProgressIsTerminal.
This commit is contained in:
@@ -82,7 +82,9 @@ func progressForReceiver(
|
||||
labelKey: L10n.Progress.interrupted, progress: nil, detail: nil
|
||||
)
|
||||
}
|
||||
if latestKind == .completed && !transferEvents.contains(where: { $0.eventKind == .progress || $0.eventKind == .started }) {
|
||||
// Events are newest-first, so a completed latest event is terminal even when
|
||||
// progress/started events precede it — it must show as Completed, not Sending.
|
||||
if latestKind == .completed {
|
||||
return TransferProgress(
|
||||
transferId: transferId, phase: .transfer, kind: .completed,
|
||||
labelKey: L10n.Progress.completed, progress: 1, detail: nil
|
||||
|
||||
Reference in New Issue
Block a user