Skip to content

Commit

Permalink
Remove redundant toggle Approve All members callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagar0-0 committed Jan 8, 2025
1 parent d95a002 commit 02f9e77
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ class CreateCallLinkBottomSheetDialogFragment : ComposeBottomSheetDialogFragment
onJoinClicked = this@CreateCallLinkBottomSheetDialogFragment::onJoinClicked,
onAddACallNameClicked = this@CreateCallLinkBottomSheetDialogFragment::onAddACallNameClicked,
onApproveAllMembersChanged = this@CreateCallLinkBottomSheetDialogFragment::setApproveAllMembers,
onToggleApproveAllMembersClicked = this@CreateCallLinkBottomSheetDialogFragment::toggleApproveAllMembers,
onShareViaSignalClicked = this@CreateCallLinkBottomSheetDialogFragment::onShareViaSignalClicked,
onCopyLinkClicked = this@CreateCallLinkBottomSheetDialogFragment::onCopyLinkClicked,
onShareLinkClicked = this@CreateCallLinkBottomSheetDialogFragment::onShareLinkClicked,
Expand Down Expand Up @@ -124,15 +123,6 @@ class CreateCallLinkBottomSheetDialogFragment : ComposeBottomSheetDialogFragment
}, onError = this::handleError)
}

private fun toggleApproveAllMembers() {
lifecycleDisposable += viewModel.toggleApproveAllMembers().subscribeBy(onSuccess = {
if (it !is UpdateCallLinkResult.Update) {
Log.w(TAG, "Failed to update call link restrictions")
toastFailure()
}
}, onError = this::handleError)
}

private fun onAddACallNameClicked() {
val snapshot = viewModel.callLink.value
findNavController().navigate(
Expand Down Expand Up @@ -242,7 +232,6 @@ private fun CreateCallLinkBottomSheetContent(
onJoinClicked: () -> Unit = {},
onAddACallNameClicked: () -> Unit = {},
onApproveAllMembersChanged: (Boolean) -> Unit = {},
onToggleApproveAllMembersClicked: () -> Unit = {},
onShareViaSignalClicked: () -> Unit = {},
onCopyLinkClicked: () -> Unit = {},
onShareLinkClicked: () -> Unit = {},
Expand Down Expand Up @@ -291,7 +280,6 @@ private fun CreateCallLinkBottomSheetContent(
checked = callLink.state.restrictions == CallLinkState.Restrictions.ADMIN_APPROVAL,
text = stringResource(id = R.string.CreateCallLinkBottomSheetDialogFragment__require_admin_approval),
onCheckChanged = onApproveAllMembersChanged,
modifier = Modifier.clickable(onClick = onToggleApproveAllMembersClicked),
isLoading = isLoadingAdminApprovalChange
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ class CreateCallLinkViewModel(
}
}

fun toggleApproveAllMembers(): Single<UpdateCallLinkResult> {
return setApproveAllMembers(_callLink.value.state.restrictions != Restrictions.ADMIN_APPROVAL)
.observeOn(AndroidSchedulers.mainThread())
}

fun setCallName(callName: String): Single<UpdateCallLinkResult> {
return commitCallLink()
.flatMap {
Expand Down

0 comments on commit 02f9e77

Please sign in to comment.