Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix navigation to speaker detail screen crash #197

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ android {
signingConfig = signingConfigs.getByName("debug")
}
named("debug") {

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import kotlinx.coroutines.flow.map
import timber.log.Timber

class SpeakersManager @Inject constructor(
private val localSpeakersDataSource: LocalSpeakersDataSource, private val remoteSpeakersDataSource: RemoteSpeakersDataSource
private val localSpeakersDataSource: LocalSpeakersDataSource,
private val remoteSpeakersDataSource: RemoteSpeakersDataSource

) : SpeakersRepo {
override fun fetchSpeakers(): Flow<List<Speaker>> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class SessionsManagerTest {
mockLocalSessionsDataSource.getCachedSessions()
}
}

}
val sessionEntity = SessionEntity(
id = 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2023 DroidconKE
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ke.droidcon.kotlin.datasource.local.di

import dagger.Module
Expand All @@ -14,7 +29,6 @@ object DispatcherModule {
@Provides
@LocalSourceIoDispatcher
fun provideIODispatcher(): CoroutineDispatcher = Dispatchers.IO

}

@Retention(AnnotationRetention.BINARY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ fun Navigation(
updateBottomBarState(true)
HomeRoute(
navigateToSpeakers = { navController.navigate(Screens.Speakers.route) },
navigateToSpeaker = { twitterHandle ->
navigateToSpeaker = { speakerId ->
navController.navigate(
Screens.SpeakerDetails.route.replace("{twitterHandle}", twitterHandle)
Screens.SpeakerDetails.route.replace(
"{speakerId}",
speakerId
)
)
},
navigateToFeedbackScreen = { navController.navigate(Screens.FeedBack.route) },
Expand All @@ -55,6 +58,7 @@ fun Navigation(
composable(Screens.Sessions.route) {
updateBottomBarState(true)
SessionsRoute(navigateToSessionDetails = { sessionId ->

navController.navigate(
Screens.SessionDetails.route.replace(
oldValue = "{sessionId}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ fun HomeSpeakersSection(
) {
items(speakers.take(8)) { speaker ->
HomeSpeakerComponent(speaker = speaker, onClick = {
if (speaker.twitterHandle != null) {
navigateToSpeaker.invoke(speaker.twitterHandle)
}
navigateToSpeaker.invoke("${speaker.id}")
paulodhiambo marked this conversation as resolved.
Show resolved Hide resolved
})
}
}
Expand Down
Loading