Cleaner - Needs UI rebuild from Master TBD
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.placeholder.sherpai2
|
||||
|
||||
import android.app.Application
|
||||
import dagger.hilt.android.HiltAndroidApp
|
||||
|
||||
class SherpAIApplication : Application() {
|
||||
|
||||
}
|
||||
@HiltAndroidApp
|
||||
class SherpAIApplication : Application()
|
||||
@@ -3,6 +3,10 @@ package com.placeholder.sherpai2.di
|
||||
import android.content.Context
|
||||
import androidx.room.Room
|
||||
import com.placeholder.sherpai2.data.local.AppDatabase
|
||||
import com.placeholder.sherpai2.data.local.dao.ImageAggregateDao
|
||||
import com.placeholder.sherpai2.data.local.dao.ImageEventDao
|
||||
import com.placeholder.sherpai2.data.local.dao.ImageTagDao
|
||||
import com.placeholder.sherpai2.data.local.dao.TagDao
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
@@ -25,4 +29,33 @@ object DatabaseModule {
|
||||
"sherpai.db"
|
||||
).build()
|
||||
}
|
||||
|
||||
// --- Add these DAO providers ---
|
||||
|
||||
@Provides
|
||||
fun provideTagDao(database: AppDatabase): TagDao {
|
||||
return database.tagDao()
|
||||
}
|
||||
|
||||
@Provides
|
||||
fun provideImageTagDao(database: AppDatabase): ImageTagDao {
|
||||
return database.imageTagDao()
|
||||
}
|
||||
|
||||
// Add providers for your other DAOs now to avoid future errors
|
||||
@Provides
|
||||
fun provideImageDao(database: AppDatabase) = database.imageDao()
|
||||
|
||||
@Provides
|
||||
fun providePersonDao(database: AppDatabase) = database.personDao()
|
||||
|
||||
@Provides
|
||||
fun provideEventDao(database: AppDatabase) = database.eventDao()
|
||||
|
||||
@Provides
|
||||
fun provideImageEventDao(database: AppDatabase): ImageEventDao = database.imageEventDao()
|
||||
|
||||
@Provides
|
||||
fun provideImageAggregateDao(database: AppDatabase): ImageAggregateDao = database.imageAggregateDao()
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import androidx.lifecycle.viewModelScope
|
||||
import com.placeholder.sherpai2.data.local.entity.TagEntity
|
||||
import com.placeholder.sherpai2.domain.repository.TaggingRepository
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
@@ -17,6 +18,7 @@ import javax.inject.Inject
|
||||
* - Tag write operations
|
||||
*/
|
||||
@HiltViewModel
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class ImageDetailViewModel @Inject constructor(
|
||||
private val tagRepository: TaggingRepository
|
||||
) : ViewModel() {
|
||||
|
||||
Reference in New Issue
Block a user