Fix Injection for InsightDbHelper

Thanks Adrian for your help
This commit is contained in:
Philoul 2021-05-09 16:20:55 +02:00
parent cd434ed4bb
commit 0020856aae
3 changed files with 2 additions and 11 deletions

View file

@ -20,8 +20,6 @@ abstract class InsightDatabase : RoomDatabase() {
abstract fun insightDatabaseDao(): InsightDatabaseDao
abstract fun insightDbHelper(): InsightDbHelper
companion object {
const val VERSION = 1

View file

@ -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)

View file

@ -22,7 +22,6 @@ class InsightDatabaseModule {
@Provides
@Singleton
internal fun provideInsightDbHelper(insightDatabase: InsightDatabase): InsightDbHelper =
insightDatabase.insightDbHelper()
internal fun provideInsightDbHelper(insightDatabaseDao: InsightDatabaseDao): InsightDbHelper = InsightDbHelper(insightDatabaseDao)
}