Skip to content

Commit

Permalink
Merge pull request #94 from sheikh-20/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sheikh-20 authored Jun 28, 2024
2 parents d2a2e73 + 351a420 commit eb6d139
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ android {
applicationId = "com.application.moviesapp"
minSdk = 24
targetSdk = 33
versionCode = 24
versionName = "1.0.23"
versionCode = 25
versionName = "1.0.24"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ fun OnboardingApp(modifier: Modifier = Modifier,

Spacer(modifier = modifier.weight(1f))


Text(
text = it.visuals.actionLabel ?: "",
fontWeight = FontWeight.SemiBold,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.material3.Divider
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.SnackbarResult
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
Expand All @@ -51,6 +52,7 @@ import com.application.moviesapp.R
import com.application.moviesapp.data.common.Resource
import com.application.moviesapp.domain.usecase.SignInGoogleInteractor
import com.application.moviesapp.ui.accountsetup.AccountSetupActivity
import com.application.moviesapp.ui.home.BottomNavigationScreens
import com.application.moviesapp.ui.home.HomeActivity
import com.application.moviesapp.ui.onboarding.OnboardingActivity
import com.application.moviesapp.ui.onboarding.component.EmailComponent
Expand Down Expand Up @@ -116,7 +118,12 @@ fun LoginWithPasswordScreen(modifier: Modifier = Modifier,
is Resource.Failure -> {
isLoading = false
if (it.throwable is FirebaseAuthInvalidUserException) {
snackbarHostState.showSnackbar(message = "Email does not exists, Try signup!")
val result = snackbarHostState.showSnackbar(message = "Email does not exists", actionLabel = "Try signup!")

when (result) {
SnackbarResult.ActionPerformed -> onSignupClick()
else -> { }
}
}
else if (it.throwable is FirebaseAuthInvalidCredentialsException) {
snackbarHostState.showSnackbar(message = "Incorrect email or password")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.SnackbarResult
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -125,8 +126,12 @@ fun SignupWithPasswordScreen(modifier: Modifier = Modifier,
isLoading = false

if (it.throwable is FirebaseAuthUserCollisionException) {
snackbarHostState.showSnackbar(message = "Already created, Try Login!")
Timber.tag("Login").e(it.throwable)
val result = snackbarHostState.showSnackbar(message = "Already created", actionLabel = "Try Login!")

when (result) {
SnackbarResult.ActionPerformed -> onSignInClick()
else -> { }
}
} else {
snackbarHostState.showSnackbar(message = "Failure!")
Timber.tag("Login").e(it.throwable)
Expand Down

0 comments on commit eb6d139

Please sign in to comment.