Refactor auto-translations and add caching

Changelog-Added: Add auto-translation caching to ruduce api usage
Closes: #843
This commit is contained in:
2023-03-30 11:15:35 -04:00
committed by William Casarin
parent 5a238502cb
commit ae82114a33
12 changed files with 225 additions and 115 deletions

View File

@@ -611,6 +611,8 @@ struct ContentView: View {
pool.register_handler(sub_id: sub_id, handler: home.handle_event)
let settings = UserSettingsStore()
self.damus_state = DamusState(pool: pool,
keypair: keypair,
likes: EventCounter(our_pubkey: pubkey),
@@ -622,12 +624,13 @@ struct ContentView: View {
previews: PreviewCache(),
zaps: Zaps(our_pubkey: pubkey),
lnurls: LNUrls(),
settings: UserSettingsStore(),
settings: settings,
relay_filters: relay_filters,
relay_metadata: metadatas,
drafts: Drafts(),
events: EventCache(),
bookmarks: BookmarksManager(pubkey: pubkey)
bookmarks: BookmarksManager(pubkey: pubkey),
translations: Translations(settings)
)
home.damus_state = self.damus_state!