mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-01-31 17:45:17 +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
|
guard
|
||||||
let translatedContent = translatedContent
|
let translatedContent = translatedContent
|
||||||
else {
|
else {
|
||||||
|
viewModel.isCurrentlyTranslating = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,6 +272,7 @@ extension StatusView {
|
|||||||
let metaContent = try MastodonMetaContent.convert(document: content)
|
let metaContent = try MastodonMetaContent.convert(document: content)
|
||||||
viewModel.content = metaContent
|
viewModel.content = metaContent
|
||||||
viewModel.translatedFromLanguage = status.reblog?.language ?? status.language
|
viewModel.translatedFromLanguage = status.reblog?.language ?? status.language
|
||||||
|
viewModel.isCurrentlyTranslating = false
|
||||||
} catch {
|
} catch {
|
||||||
assertionFailure(error.localizedDescription)
|
assertionFailure(error.localizedDescription)
|
||||||
viewModel.content = PlaintextMetaContent(string: "")
|
viewModel.content = PlaintextMetaContent(string: "")
|
||||||
@ -305,6 +307,7 @@ extension StatusView {
|
|||||||
let metaContent = try MastodonMetaContent.convert(document: content)
|
let metaContent = try MastodonMetaContent.convert(document: content)
|
||||||
viewModel.content = metaContent
|
viewModel.content = metaContent
|
||||||
viewModel.translatedFromLanguage = nil
|
viewModel.translatedFromLanguage = nil
|
||||||
|
viewModel.isCurrentlyTranslating = false
|
||||||
} catch {
|
} catch {
|
||||||
assertionFailure(error.localizedDescription)
|
assertionFailure(error.localizedDescription)
|
||||||
viewModel.content = PlaintextMetaContent(string: "")
|
viewModel.content = PlaintextMetaContent(string: "")
|
||||||
|
@ -47,9 +47,7 @@ extension StatusView {
|
|||||||
|
|
||||||
// Translation
|
// Translation
|
||||||
@Published public var isCurrentlyTranslating = false
|
@Published public var isCurrentlyTranslating = false
|
||||||
@Published public var translatedFromLanguage: String? {
|
@Published public var translatedFromLanguage: String?
|
||||||
didSet { isCurrentlyTranslating = false }
|
|
||||||
}
|
|
||||||
|
|
||||||
@Published public var timestamp: Date?
|
@Published public var timestamp: Date?
|
||||||
public var timestampFormatter: ((_ date: Date) -> String)?
|
public var timestampFormatter: ((_ date: Date) -> String)?
|
||||||
@ -143,6 +141,7 @@ extension StatusView {
|
|||||||
isMediaSensitive = false
|
isMediaSensitive = false
|
||||||
isSensitiveToggled = false
|
isSensitiveToggled = false
|
||||||
translatedFromLanguage = nil
|
translatedFromLanguage = nil
|
||||||
|
isCurrentlyTranslating = false
|
||||||
|
|
||||||
activeFilters = []
|
activeFilters = []
|
||||||
filterContext = nil
|
filterContext = nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user