mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-01-31 09:35:13 +01:00
fix: Don't make isCurrentlyTranslating depend on translatedFromLanguage
This commit is contained in:
parent
7368e487af
commit
da3c9a42ec
@ -262,6 +262,7 @@ extension StatusView {
|
||||
guard
|
||||
let translatedContent = translatedContent
|
||||
else {
|
||||
viewModel.isCurrentlyTranslating = false
|
||||
return
|
||||
}
|
||||
|
||||
@ -271,6 +272,7 @@ extension StatusView {
|
||||
let metaContent = try MastodonMetaContent.convert(document: content)
|
||||
viewModel.content = metaContent
|
||||
viewModel.translatedFromLanguage = status.reblog?.language ?? status.language
|
||||
viewModel.isCurrentlyTranslating = false
|
||||
} catch {
|
||||
assertionFailure(error.localizedDescription)
|
||||
viewModel.content = PlaintextMetaContent(string: "")
|
||||
@ -305,6 +307,7 @@ extension StatusView {
|
||||
let metaContent = try MastodonMetaContent.convert(document: content)
|
||||
viewModel.content = metaContent
|
||||
viewModel.translatedFromLanguage = nil
|
||||
viewModel.isCurrentlyTranslating = false
|
||||
} catch {
|
||||
assertionFailure(error.localizedDescription)
|
||||
viewModel.content = PlaintextMetaContent(string: "")
|
||||
|
@ -47,9 +47,7 @@ extension StatusView {
|
||||
|
||||
// Translation
|
||||
@Published public var isCurrentlyTranslating = false
|
||||
@Published public var translatedFromLanguage: String? {
|
||||
didSet { isCurrentlyTranslating = false }
|
||||
}
|
||||
@Published public var translatedFromLanguage: String?
|
||||
|
||||
@Published public var timestamp: Date?
|
||||
public var timestampFormatter: ((_ date: Date) -> String)?
|
||||
@ -143,6 +141,7 @@ extension StatusView {
|
||||
isMediaSensitive = false
|
||||
isSensitiveToggled = false
|
||||
translatedFromLanguage = nil
|
||||
isCurrentlyTranslating = false
|
||||
|
||||
activeFilters = []
|
||||
filterContext = nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user