Moved preloadBankList() to BankingPresenter (so this also works on JavaFx)

This commit is contained in:
dankito 2020-04-24 17:29:51 +02:00
parent 7b8b18ca0b
commit fcd7e6c0ba
2 changed files with 6 additions and 8 deletions

View File

@ -89,6 +89,11 @@ open class BankingPresenter(
threadPool.runAsync {
readPersistedAccounts()
}
// preloadBankList asynchronously; on Android it takes approximately 18 seconds till banks are indexed for first time -> do it as early as possible
threadPool.runAsync {
bankFinder.preloadBankList()
}
}

View File

@ -81,14 +81,7 @@ class BankingModule(internal val mainActivity: AppCompatActivity) {
@Provides
@Singleton
fun provideBankFinder(@Named(IndexFolderKey) indexFolder: File, threadPool: IThreadPool) : IBankFinder {
val bankFinder = LuceneBankFinder(indexFolder)
// preloadBankList asynchronously; on Android it takes approximately 18 seconds till banks are indexed for first time -> do it as early as possible
threadPool.runAsync {
bankFinder.preloadBankList()
}
return bankFinder
return LuceneBankFinder(indexFolder)
}
@Provides