RepositoryModule: fix wrong injection for dateUtils

The module class is not supposed to have things injected into it. @Provides-annotated methods
will have their parameters injected, instead.

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
Álvaro Brey 2022-12-19 17:35:19 +01:00
parent 349844391e
commit 8bc5735751
No known key found for this signature in database
GPG key ID: 2585783189A62105

View file

@ -48,21 +48,17 @@ import com.nextcloud.talk.utils.database.user.CurrentUserProviderNew
import dagger.Module
import dagger.Provides
import okhttp3.OkHttpClient
import javax.inject.Inject
@Module
class RepositoryModule {
@Inject
lateinit var dateUtils: DateUtils
@Provides
fun provideConversationsRepository(ncApi: NcApi, userProvider: CurrentUserProviderNew): ConversationsRepository {
return ConversationsRepositoryImpl(ncApi, userProvider)
}
@Provides
fun provideSharedItemsRepository(ncApi: NcApi): SharedItemsRepository {
fun provideSharedItemsRepository(ncApi: NcApi, dateUtils: DateUtils): SharedItemsRepository {
return SharedItemsRepositoryImpl(ncApi, dateUtils)
}