Revert "Refactor auto-translations and add caching"

There are quite a few issues with this and is causing crashing

This reverts commit ae82114a33.
This commit is contained in:
William Casarin
2023-03-31 10:01:31 -07:00
parent 9ba3543d91
commit f2ce146e98
12 changed files with 116 additions and 226 deletions

View File

@@ -280,6 +280,17 @@ class UserSettingsStore: ObservableObject {
private func clearDeepLApiKey() throws {
try Vault.deletePrivateKey(keychainConfiguration: DamusDeepLKeychainConfiguration())
}
func can_translate(_ pubkey: String) -> Bool {
switch translation_service {
case .none:
return false
case .libretranslate:
return URLComponents(string: libretranslate_url) != nil
case .deepl:
return deepl_api_key != ""
}
}
}
struct DamusLibreTranslateKeychainConfiguration: KeychainConfiguration {