mirror of
https://github.com/etesync/android
synced 2024-11-26 01:48:34 +00:00
App: only init the data store once per application.
We were accidentally initialising it once every time we were trying to access it.
This commit is contained in:
parent
9ed172e23c
commit
26ea8900a2
@ -51,8 +51,7 @@ class App : Application() {
|
|||||||
* `@Provides @Singleton`.
|
* `@Provides @Singleton`.
|
||||||
*/
|
*/
|
||||||
// override onUpgrade to handle migrating to a new version
|
// override onUpgrade to handle migrating to a new version
|
||||||
val data: MyEntityDataStore
|
val data = initDataStore()
|
||||||
get() = initDataStore()
|
|
||||||
|
|
||||||
fun initDataStore(): MyEntityDataStore {
|
fun initDataStore(): MyEntityDataStore {
|
||||||
val source = MyDatabaseSource(this, Models.DEFAULT, 4)
|
val source = MyDatabaseSource(this, Models.DEFAULT, 4)
|
||||||
|
Loading…
Reference in New Issue
Block a user