Skip to content

Commit 69a57b1

Browse files
committed
[BOOK-434] fix: build problem WIP
1 parent e8af5fa commit 69a57b1

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

app/src/main/kotlin/com/ninecraft/booket/di/AppGraph.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import android.app.Service
66
import android.content.Context
77
import com.ninecraft.booket.core.di.DataScope
88
import dev.zacsweers.metro.AppScope
9+
import dev.zacsweers.metro.Binds
910
import dev.zacsweers.metro.DependencyGraph
1011
import dev.zacsweers.metro.Multibinds
1112
import dev.zacsweers.metro.Provider
@@ -18,8 +19,11 @@ import kotlin.reflect.KClass
1819
)
1920
interface AppGraph {
2021

21-
@Provides
22-
fun provideApplicationContext(application: Application): Context = application
22+
// @Provides
23+
// fun provideApplicationContext(application: Application): Context = application
24+
25+
@Binds
26+
fun bindContext(application: Application): Context
2327

2428
@Multibinds(allowEmpty = true)
2529
val activityProviders: Map<KClass<out Activity>, Provider<Activity>>

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/di/DataGraph.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ interface DataGraph {
3131

3232
@Binds
3333
val DefaultUserRepository.bind: UserRepository
34-
}
34+
}

core/di/src/main/kotlin/com/ninecraft/booket/core/di/ActivityKey.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ import kotlin.reflect.KClass
77
/** A [MapKey] annotation for binding Activities in a multibinding map. */
88
@MapKey
99
@Target(AnnotationTarget.CLASS)
10-
annotation class ActivityKey(val value: KClass<out Activity>)
10+
annotation class ActivityKey(val value: KClass<out Activity>)

core/di/src/main/kotlin/com/ninecraft/booket/core/di/ServiceKey.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ import kotlin.reflect.KClass
66

77
@MapKey
88
@Target(AnnotationTarget.CLASS)
9-
annotation class ServiceKey(val value: KClass<out Service>)
9+
annotation class ServiceKey(val value: KClass<out Service>)

core/network/src/main/kotlin/com/ninecraft/booket/core/network/TokenAuthenticator.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import okhttp3.Route
1818
@Inject
1919
class TokenAuthenticator(
2020
private val tokenDataSource: TokenDataSource,
21-
private val serviceProvider: Provider<ReedService>,
21+
// private val serviceProvider: Provider<ReedService>,
22+
private val serviceLazy: Lazy<ReedService>,
2223
) : Authenticator {
2324
override fun authenticate(route: Route?, response: Response): Request? {
2425
return runBlocking {
@@ -32,7 +33,8 @@ class TokenAuthenticator(
3233
}
3334

3435
val refreshTokenRequest = RefreshTokenRequest(refreshToken)
35-
val refreshResponse = serviceProvider().refreshToken(refreshTokenRequest)
36+
// val refreshResponse = serviceProvider().refreshToken(refreshTokenRequest)
37+
val refreshResponse = serviceLazy.value.refreshToken(refreshTokenRequest)
3638

3739
tokenDataSource.apply {
3840
setAccessToken(refreshResponse.accessToken)

0 commit comments

Comments
 (0)