Skip to content

Commit

Permalink
Changed error message in Basic Authentication to be the same than the…
Browse files Browse the repository at this point in the history
… others
  • Loading branch information
Aitorbp committed Mar 12, 2024
1 parent b64ce23 commit 5cb10a8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ protected void showRequestAccountChangeNotice(String errorMessage, boolean mustC
.show();
} else {
Snackbar.make(findViewById(android.R.id.content), errorMessage, Snackbar.LENGTH_INDEFINITE)
.setAction(R.string.auth_failure_snackbar_action, v ->
.setAction(R.string.auth_oauth_failure_snackbar_action, v ->
requestCredentialsUpdate())
.show();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@ class FileDisplayActivity : FileActivity(),
}

private fun initAndShowListOfSpaces() {
val listOfSpaces = SpacesListFragment.newInstance(showPersonalSpace = false, accountName = com.owncloud.android.presentation.authentication.AccountUtils.getCurrentOwnCloudAccount(applicationContext).name)
val listOfSpaces = SpacesListFragment.newInstance(
showPersonalSpace = false,
accountName = com.owncloud.android.presentation.authentication.AccountUtils.getCurrentOwnCloudAccount(applicationContext).name
)
this.fileListOption = FileListOption.SPACES_LIST
val transaction = supportFragmentManager.beginTransaction()
transaction.replace(R.id.left_fragment_container, listOfSpaces, TAG_LIST_OF_SPACES)
Expand Down Expand Up @@ -1351,7 +1354,6 @@ class FileDisplayActivity : FileActivity(),
is UnauthorizedException -> {
launch(Dispatchers.IO) {
val credentials = AccountUtils.getCredentialsForAccount(MainApp.appContext, account)

launch(Dispatchers.Main) {
if (credentials is OwnCloudBearerCredentials) { // OAuth
showRequestRegainAccess()
Expand Down Expand Up @@ -1790,24 +1792,28 @@ class FileDisplayActivity : FileActivity(),
is UIResult.Loading -> {
showLoadingDialog(R.string.deep_link_loading)
}

is UIResult.Success -> {
intent?.data = null
dismissLoadingDialog()
uiResult.data?.let { it1 -> manageItem(it1) }
}

is UIResult.Error -> {
dismissLoadingDialog()
if (uiResult.error is FileNotFoundException) {
showMessageInSnackbar(message = getString(R.string.deep_link_user_no_access))
changeUser()
} else {
showMessageInSnackbar(message = getString(
if (uiResult.error is DeepLinkException) {
R.string.invalid_deep_link_format
} else {
R.string.default_error_msg
}
))
showMessageInSnackbar(
message = getString(
if (uiResult.error is DeepLinkException) {
R.string.invalid_deep_link_format
} else {
R.string.default_error_msg
}
)
)
}
}
}
Expand Down

0 comments on commit 5cb10a8

Please sign in to comment.