Moved preloadBankList() to BankingPresenter (so this also works on JavaFx)
This commit is contained in:
parent
7b8b18ca0b
commit
fcd7e6c0ba
|
@ -89,6 +89,11 @@ open class BankingPresenter(
|
||||||
threadPool.runAsync {
|
threadPool.runAsync {
|
||||||
readPersistedAccounts()
|
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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -81,14 +81,7 @@ class BankingModule(internal val mainActivity: AppCompatActivity) {
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
fun provideBankFinder(@Named(IndexFolderKey) indexFolder: File, threadPool: IThreadPool) : IBankFinder {
|
fun provideBankFinder(@Named(IndexFolderKey) indexFolder: File, threadPool: IThreadPool) : IBankFinder {
|
||||||
val bankFinder = LuceneBankFinder(indexFolder)
|
return 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
|
Loading…
Reference in New Issue