Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="not_now">Ahora no</string>
<string name="login_error_try_again_later">Algo salió mal. Por favor, inténtalo de nuevo más tarde.</string>
<string name="login_error_connection">Se agotó el tiempo de conexión. Verifica tu internet e inténtalo de nuevo.</string>
<string name="login_error_email_required">Necesitas compartir tu correo electrónico para iniciar sesión. Inténtalo de nuevo y elige compartirlo.</string>
<string name="no_google_account_title">Sin cuenta de Google</string>
<string name="no_google_account_message">Tu dispositivo no tiene una cuenta de Google. Agrega una para continuar con el inicio de sesión con Google.</string>
<string name="no_google_account_confirm">Agregar cuenta</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="not_now">Agora não</string>
<string name="login_error_try_again_later">Algo deu errado. Por favor, tente novamente mais tarde.</string>
<string name="login_error_connection">Tempo de conexão esgotado. Verifique sua internet e tente novamente.</string>
<string name="login_error_email_required">Você precisa compartilhar seu e-mail para entrar. Tente novamente e escolha compartilhá-lo.</string>
<string name="no_google_account_title">Nenhuma conta Google</string>
<string name="no_google_account_message">Seu dispositivo não tem uma conta Google. Adicione uma para continuar o login com o Google.</string>
<string name="no_google_account_confirm">Adicionar conta</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="not_now">Not now</string>
<string name="login_error_try_again_later">Something went wrong. Please try again later.</string>
<string name="login_error_connection">Connection timed out. Check your internet and try again.</string>
<string name="login_error_email_required">You need to share your email to sign in. Try again and choose to share it.</string>
<string name="no_google_account_title">No Google account</string>
<string name="no_google_account_message">Your device doesn't have a Google account. Add one to continue signing in with Google.</string>
<string name="no_google_account_confirm">Add account</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.compose.ui.text.withLink
import androidx.compose.ui.unit.dp
import bibleplanner.feature.login.generated.resources.Res
import bibleplanner.feature.login.generated.resources.login_error_connection
import bibleplanner.feature.login.generated.resources.login_error_email_required
import bibleplanner.feature.login.generated.resources.login_error_try_again_later
import bibleplanner.feature.login.generated.resources.not_now
import bibleplanner.feature.login.generated.resources.privacy_policy
Expand Down Expand Up @@ -130,5 +131,6 @@ fun LoginBottomSheet(
private val LoginError.messageRes: StringResource
get() = when (this) {
LoginError.CONNECTION -> Res.string.login_error_connection
LoginError.EMAIL_REQUIRED -> Res.string.login_error_email_required
LoginError.GENERIC -> Res.string.login_error_try_again_later
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,21 @@ import io.ktor.client.plugins.HttpRequestTimeoutException
* decides which message the user sees.
*/
internal class ThrowableToLoginErrorMapper {
operator fun invoke(throwable: Throwable?): LoginError = when (throwable) {
is HttpRequestTimeoutException -> LoginError.CONNECTION
operator fun invoke(throwable: Throwable?): LoginError = when {
throwable is HttpRequestTimeoutException -> LoginError.CONNECTION
throwable.isMissingProviderEmail() -> LoginError.EMAIL_REQUIRED
else -> LoginError.GENERIC
}

/**
* Whether [this] is the auth server rejecting the sign-in because the provider returned no email —
* e.g. Apple sign-in with the email scope withheld, which Supabase blocks while "Allow users
* without an email" is off. The server reports it with [MISSING_PROVIDER_EMAIL_MESSAGE].
*/
private fun Throwable?.isMissingProviderEmail(): Boolean =
this?.message?.contains(MISSING_PROVIDER_EMAIL_MESSAGE, ignoreCase = true) == true

private companion object {
const val MISSING_PROVIDER_EMAIL_MESSAGE = "Error getting user email from external provider"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package com.quare.bibleplanner.feature.login.presentation.model
enum class LoginError {
/** The request to the auth server timed out or could not reach the network. */
CONNECTION,

/** Any other, unexpected failure. */
EMAIL_REQUIRED,
GENERIC,
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"Fixed an issue that could stop a Bible version download when the app was in the background.",
"The Terms of Service and Privacy Policy links on the login screen now open when you tap them.",
"Fixed the Gospel of John showing the wrong text or appearing as not downloaded; it now downloads and displays correctly.",
"When your device has no Google account, signing in with Google now explains this and lets you add one, instead of showing a generic error."
"When your device has no Google account, signing in with Google now explains this and lets you add one, instead of showing a generic error.",
"When you sign in with Apple without sharing your email, the app now explains that your email is required and asks you to try again, instead of showing a generic error."
],
"1.15.0": [
"The reading plan screen now uses a two-column layout on tablets and larger displays, with the progress panel on the left and the weeks list on the right, both scrollable independently across the full screen.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"Se corrigió un problema que podía detener la descarga de una versión de la Biblia cuando la app estaba en segundo plano.",
"Los enlaces de Términos de Servicio y Política de Privacidad en la pantalla de inicio de sesión ahora se abren al tocarlos.",
"Se corrigió el Evangelio de Juan que mostraba el texto incorrecto o aparecía como no descargado; ahora se descarga y se muestra correctamente.",
"Cuando tu dispositivo no tiene una cuenta de Google, el inicio de sesión con Google ahora te lo explica y te permite agregar una, en lugar de mostrar un error genérico."
"Cuando tu dispositivo no tiene una cuenta de Google, el inicio de sesión con Google ahora te lo explica y te permite agregar una, en lugar de mostrar un error genérico.",
"Al iniciar sesión con Apple sin compartir tu correo, la app ahora te explica que el correo es necesario y te pide intentarlo de nuevo, en lugar de mostrar un error genérico."
],
"1.15.0": [
"La pantalla del plan de lectura ahora usa un diseño de dos columnas en tabletas y pantallas más grandes, con el panel de progreso a la izquierda y la lista de semanas a la derecha, ambos con desplazamiento independiente en todo el ancho de la pantalla.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"Corrigido um problema que podia interromper o download de uma versão da Bíblia quando o app estava em segundo plano.",
"Os links de Termos de Serviço e Política de Privacidade na tela de login agora abrem ao tocar neles.",
"Corrigido o Evangelho de João que exibia o texto errado ou aparecia como não baixado; agora ele é baixado e exibido corretamente.",
"Quando o aparelho não tem uma conta Google, o login com o Google agora explica isso e permite adicionar uma conta, em vez de mostrar um erro genérico."
"Quando o aparelho não tem uma conta Google, o login com o Google agora explica isso e permite adicionar uma conta, em vez de mostrar um erro genérico.",
"Ao fazer login com a Apple sem compartilhar seu e-mail, o app agora explica que o e-mail é necessário e pede para tentar novamente, em vez de mostrar um erro genérico."
],
"1.15.0": [
"A tela do plano de leitura agora usa um layout em duas colunas em tablets e telas maiores, com o painel de progresso à esquerda e a lista de semanas à direita, ambos com rolagem independente em toda a largura da tela.",
Expand Down
Loading