Add proper toast message when call link in use.
This commit is contained in:
parent
d95a002e54
commit
5a9bc49492
2 changed files with 13 additions and 2 deletions
|
@ -166,9 +166,14 @@ class CallLinkDetailsFragment : ComposeFragment(), CallLinkDetailsCallback {
|
||||||
|
|
||||||
override fun onApproveAllMembersChanged(checked: Boolean) {
|
override fun onApproveAllMembersChanged(checked: Boolean) {
|
||||||
lifecycleDisposable += viewModel.setApproveAllMembers(checked).observeOn(AndroidSchedulers.mainThread()).subscribeBy(onSuccess = {
|
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")
|
Log.w(TAG, "Failed to change restrictions. $it")
|
||||||
toastFailure()
|
|
||||||
|
if (it.status == 409.toShort()) {
|
||||||
|
toastCallLinkInUse()
|
||||||
|
} else {
|
||||||
|
toastFailure()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, onError = handleError("onApproveAllMembersChanged"))
|
}, 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() {
|
private fun toastFailure() {
|
||||||
Toast.makeText(requireContext(), R.string.CallLinkDetailsFragment__couldnt_save_changes, Toast.LENGTH_LONG).show()
|
Toast.makeText(requireContext(), R.string.CallLinkDetailsFragment__couldnt_save_changes, Toast.LENGTH_LONG).show()
|
||||||
}
|
}
|
||||||
|
|
|
@ -7264,6 +7264,8 @@
|
||||||
<string name="CallLinkDetailsFragment__delete_call_link">Delete call link</string>
|
<string name="CallLinkDetailsFragment__delete_call_link">Delete call link</string>
|
||||||
<!-- Displayed whenever a name change, revocation, etc, fails. -->
|
<!-- 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>
|
<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 -->
|
<!-- 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>
|
<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 -->
|
<!-- Displayed as title in dialog when user attempts to delete the link -->
|
||||||
|
|
Loading…
Add table
Reference in a new issue