App: only init the data store once per application.

We were accidentally initialising it once every time we were
trying to access it.
pull/96/head
Tom Hacohen 5 years ago
parent 9ed172e23c
commit 26ea8900a2

@ -51,8 +51,7 @@ class App : Application() {
* `@Provides @Singleton`.
*/
// override onUpgrade to handle migrating to a new version
val data: MyEntityDataStore
get() = initDataStore()
val data = initDataStore()
fun initDataStore(): MyEntityDataStore {
val source = MyDatabaseSource(this, Models.DEFAULT, 4)

Loading…
Cancel
Save