Add proper toast message when call link in use.

This commit is contained in:
Alex Hart 2025-01-07 17:03:38 -04:00
parent d95a002e54
commit 5a9bc49492
2 changed files with 13 additions and 2 deletions

View file

@ -166,9 +166,14 @@ class CallLinkDetailsFragment : ComposeFragment(), CallLinkDetailsCallback {
override fun onApproveAllMembersChanged(checked: Boolean) {
lifecycleDisposable += viewModel.setApproveAllMembers(checked).observeOn(AndroidSchedulers.mainThread()).subscribeBy(onSuccess = {
if (it !is UpdateCallLinkResult.Update) {
if (it is UpdateCallLinkResult.Failure) {
Log.w(TAG, "Failed to change restrictions. $it")
toastFailure()
if (it.status == 409.toShort()) {
toastCallLinkInUse()
} else {
toastFailure()
}
}
}, onError = handleError("onApproveAllMembersChanged"))
}
@ -189,6 +194,10 @@ class CallLinkDetailsFragment : ComposeFragment(), CallLinkDetailsCallback {
}
}
private fun toastCallLinkInUse() {
Toast.makeText(requireContext(), R.string.CallLinkDetailsFragment__couldnt_update_admin_approval, Toast.LENGTH_LONG).show()
}
private fun toastFailure() {
Toast.makeText(requireContext(), R.string.CallLinkDetailsFragment__couldnt_save_changes, Toast.LENGTH_LONG).show()
}

View file

@ -7264,6 +7264,8 @@
<string name="CallLinkDetailsFragment__delete_call_link">Delete call link</string>
<!-- Displayed whenever a name change, revocation, etc, fails. -->
<string name="CallLinkDetailsFragment__couldnt_save_changes">Couldn\'t save changes. Check your network connection and try again.</string>
<!-- Displayed whenever an admin update fails with a 409. -->
<string name="CallLinkDetailsFragment__couldnt_update_admin_approval">Couldn\'t update admin approval settings. Check the call link is not currently in use.</string>
<!-- Displayed when the call link is in use when the user tries to delete it -->
<string name="CallLinkDetailsFragment__couldnt_delete_call_link">Couldn\'t delete call link as it is currently in use.</string>
<!-- Displayed as title in dialog when user attempts to delete the link -->