Skip to content

Commit

Permalink
fix(auth): pass forgotPasswordScreen & emailLoginLinkScreen as nested…
Browse files Browse the repository at this point in the history
…Graph in loginWithEmailScreen to fix broken forgot password button
  • Loading branch information
deepanchal committed Sep 4, 2023
1 parent c0f4c37 commit 51eb431
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import com.crisiscleanup.core.appnav.RouteConstant
import com.crisiscleanup.feature.authentication.navigation.authGraph
import com.crisiscleanup.feature.authentication.navigation.emailLoginLinkScreen
import com.crisiscleanup.feature.authentication.navigation.forgotPasswordScreen
import com.crisiscleanup.feature.authentication.navigation.loginWithEmailScreen
import com.crisiscleanup.feature.authentication.navigation.navigateToEmailLoginLink
import com.crisiscleanup.feature.authentication.navigation.navigateToForgotPassword
Expand Down Expand Up @@ -41,6 +43,14 @@ fun CrisisCleanupAuthNavHost(
closeAuthentication = closeAuthentication,
openForgotPassword = navToForgotPassword,
openEmailMagicLink = navToEmailMagicLink,
nestedGraphs = {
forgotPasswordScreen(
onBack = onBack,
)
emailLoginLinkScreen(
onBack = onBack,
)
},
)
},
openLoginWithEmail = navToLoginWithEmail,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fun NavController.navigateToLoginWithEmail() {

fun NavGraphBuilder.loginWithEmailScreen(
enableBackHandler: Boolean,
nestedGraphs: NavGraphBuilder.() -> Unit,
onBack: () -> Unit,
closeAuthentication: () -> Unit,
openForgotPassword: () -> Unit,
Expand All @@ -26,4 +27,5 @@ fun NavGraphBuilder.loginWithEmailScreen(
closeAuthentication = closeAuthentication,
)
}
nestedGraphs()
}

0 comments on commit 51eb431

Please sign in to comment.