Disable translations in DMs by default

There is an option to enable it now.

Changelog-Changed: Disable translations in DMs by default
This commit is contained in:
William Casarin
2023-04-06 12:07:01 -07:00
parent 7fb1bc48c4
commit 24c82293b3
7 changed files with 34 additions and 19 deletions

View File

@@ -51,10 +51,18 @@ struct DirectMessagesView: View {
}
}
var options: EventViewOptions {
if self.damus_state.settings.translate_dms {
return [.truncate_content]
}
return [.truncate_content, .no_translate]
}
func MaybeEvent(_ tup: (String, DirectMessageModel)) -> some View {
Group {
if let ev = tup.1.events.last {
EventView(damus: damus_state, event: ev, pubkey: tup.0)
EventView(damus: damus_state, event: ev, pubkey: tup.0, options: options)
.onTapGesture {
pubkey = tup.0
active_model = tup.1