Fix Injection for InsightDbHelper
Thanks Adrian for your help
This commit is contained in:
parent
cd434ed4bb
commit
0020856aae
|
@ -20,8 +20,6 @@ abstract class InsightDatabase : RoomDatabase() {
|
|||
|
||||
abstract fun insightDatabaseDao(): InsightDatabaseDao
|
||||
|
||||
abstract fun insightDbHelper(): InsightDbHelper
|
||||
|
||||
companion object {
|
||||
|
||||
const val VERSION = 1
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
package info.nightscout.androidaps.insight.database
|
||||
|
||||
import androidx.room.Dao
|
||||
import javax.inject.Inject
|
||||
|
||||
@Dao
|
||||
abstract class InsightDbHelper {
|
||||
|
||||
@Inject lateinit var insightDatabaseDao: InsightDatabaseDao
|
||||
class InsightDbHelper (val insightDatabaseDao: InsightDatabaseDao) {
|
||||
|
||||
fun getInsightBolusID(pumpSerial: String, bolusID: Int, timestamp: Long): InsightBolusID? = insightDatabaseDao.getInsightBolusID(pumpSerial, bolusID, timestamp)
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ class InsightDatabaseModule {
|
|||
|
||||
@Provides
|
||||
@Singleton
|
||||
internal fun provideInsightDbHelper(insightDatabase: InsightDatabase): InsightDbHelper =
|
||||
insightDatabase.insightDbHelper()
|
||||
internal fun provideInsightDbHelper(insightDatabaseDao: InsightDatabaseDao): InsightDbHelper = InsightDbHelper(insightDatabaseDao)
|
||||
|
||||
}
|
Loading…
Reference in a new issue