mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-11-03 14:17:19 +01:00
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
678 B
Swift
25 lines
678 B
Swift
import Foundation
|
|
|
|
/// The observable state of one pre-upload.
|
|
///
|
|
/// `Value` is whatever the producer eventually yields — in this project, a cloud `Media`.
|
|
/// The registry itself never inspects it.
|
|
public enum PreuploadState<Value> {
|
|
case progress(Float)
|
|
case done(Value)
|
|
case failed
|
|
}
|
|
|
|
public extension PreuploadState {
|
|
/// `.progress` is the only non-terminal state. The registry relies on this to know when a
|
|
/// context has finished and when a `join` subscriber may be completed.
|
|
var isTerminal: Bool {
|
|
switch self {
|
|
case .progress:
|
|
return false
|
|
case .done, .failed:
|
|
return true
|
|
}
|
|
}
|
|
}
|