mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-25 01:31:02 +00:00
Handle uncached attachments
This commit is contained in:
parent
b2e56a1b9b
commit
45820517e9
2 changed files with 9 additions and 3 deletions
|
@ -329,7 +329,11 @@ public extension StatusViewModel {
|
|||
}
|
||||
|
||||
func attachmentSelected(viewModel: AttachmentViewModel) {
|
||||
eventsSubject.send(Just(.attachment(viewModel, self)).setFailureType(to: Error.self).eraseToAnyPublisher())
|
||||
if viewModel.attachment.type == .unknown, let remoteUrl = viewModel.attachment.remoteUrl {
|
||||
urlSelected(remoteUrl)
|
||||
} else {
|
||||
eventsSubject.send(Just(.attachment(viewModel, self)).setFailureType(to: Error.self).eraseToAnyPublisher())
|
||||
}
|
||||
}
|
||||
|
||||
func shareStatus() {
|
||||
|
|
|
@ -177,8 +177,10 @@ private extension AttachmentView {
|
|||
playImageView.image = UIImage(systemName: "waveform.circle",
|
||||
withConfiguration: UIImage.SymbolConfiguration(textStyle: .largeTitle))
|
||||
backgroundColor = .secondarySystemBackground
|
||||
default:
|
||||
break
|
||||
case .unknown:
|
||||
playImageView.image = UIImage(systemName: "link",
|
||||
withConfiguration: UIImage.SymbolConfiguration(textStyle: .largeTitle))
|
||||
backgroundColor = .secondarySystemBackground
|
||||
}
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
|
|
Loading…
Reference in a new issue