Skip to content

Commit

Permalink
Fixed continueBasedOnFlavorSettings().| #2162
Browse files Browse the repository at this point in the history
  • Loading branch information
DenBond7 committed Mar 2, 2023
1 parent ebb81ca commit 0fd42bf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class MainSignInFragment : BaseSingInFragment<FragmentMainSignInBinding>() {
)
}
} else {
continueBasedOnFlavorSettings()
continueBasedOnFlavorSettings(getString(R.string.fes_server_has_wrong_settings))
}

checkCustomerUrlFesServerViewModel.checkFesServerAvailabilityLiveData.value =
Expand All @@ -559,7 +559,12 @@ class MainSignInFragment : BaseSingInFragment<FragmentMainSignInBinding>() {
when (it.exception) {
is CommonConnectionException -> {
if (it.exception.hasInternetAccess == true) {
continueBasedOnFlavorSettings()
continueBasedOnFlavorSettings(
getString(
R.string.check_fes_error_with_retry,
it.exceptionMsg
)
)
} else {
showDialogWithRetryButton(
getString(R.string.no_connection_or_server_is_not_reachable),
Expand All @@ -575,7 +580,12 @@ class MainSignInFragment : BaseSingInFragment<FragmentMainSignInBinding>() {
}

else -> {
continueBasedOnFlavorSettings()
continueBasedOnFlavorSettings(
getString(
R.string.fes_server_error,
it.exceptionMsg
)
)
}
}
}
Expand All @@ -602,14 +612,12 @@ class MainSignInFragment : BaseSingInFragment<FragmentMainSignInBinding>() {
}
}

private fun continueBasedOnFlavorSettings() {
private fun continueBasedOnFlavorSettings(errorMsg: String) {
if (BuildConfig.FLAVOR == Constants.FLAVOR_NAME_ENTERPRISE) {
/*
here we actually need to decide if we should show error or proceed with
regular setup flow based on exact customers that will skip to regular setup flow,
and the rest will be shown error.
*/
continueWithRegularFlow()
showDialogWithRetryButton(
errorMsg,
REQUEST_CODE_RETRY_CHECK_FES_AVAILABILITY
)
} else {
continueWithRegularFlow()
}
Expand Down
3 changes: 3 additions & 0 deletions FlowCrypt/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@
<string name="need_post_notification_permission">Нам нужно разрешение, чтобы показывать уведомления о новых сообщениях</string>
<string name="ask">Спросить</string>
<string name="password_should_fit_all_requirements">Пароль должен соответствовать всем требованиям</string>
<string name="fes_server_has_wrong_settings">Ваш FES сервер настроен неверно. Пожалуйста, обратитесь в службу поддержки.</string>
<string name="check_fes_error_with_retry">Произошла ошибка.\nПодробности:%1$s\n\nПожалуйста, попробуйте еще раз.</string>
<string name="fes_server_error">Ошибка сервера:%1$s</string>
<plurals name="found_backup_of_your_account_key">
<item quantity="one">Найдена %1$d резервная копия Вашего ключа</item>
<item quantity="few">Найдено %1$d резервные копии Вашего ключа</item>
Expand Down
3 changes: 3 additions & 0 deletions FlowCrypt/src/main/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,9 @@
<string name="need_post_notification_permission">Нам потрібен дозвіл, щоб показувати сповіщення про нові листи</string>
<string name="ask">Запитати</string>
<string name="password_should_fit_all_requirements">Пароль має відповідати всім вимогам</string>
<string name="fes_server_has_wrong_settings">Ваш FES сервер налаштований не вірно. Будь ласка, зверніться до служби підтримки.</string>
<string name="check_fes_error_with_retry">Виникла помилка.\nДеталі:%1$s\n\nБудь ласка, спробуйте ще раз.</string>
<string name="fes_server_error">Помилка сервера:%1$s</string>
<plurals name="found_backup_of_your_account_key">
<item quantity="one">Знайдена %1$d резервна копія Вашого ключа</item>
<item quantity="few">Знайдено %1$d резервні копії Вашого ключа</item>
Expand Down
3 changes: 3 additions & 0 deletions FlowCrypt/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -580,4 +580,7 @@
<string name="need_post_notification_permission">We need permission to show notifications about new messages</string>
<string name="ask">Ask</string>
<string name="password_should_fit_all_requirements">Password should fit all requirements</string>
<string name="fes_server_has_wrong_settings">Your FES server has the wrong settings. Please ask your help desk for help.</string>
<string name="check_fes_error_with_retry">An error occurred.\nDetails:%1$s\n\nPlease try again.</string>
<string name="fes_server_error">Server error:%1$s</string>
</resources>

0 comments on commit 0fd42bf

Please sign in to comment.