Skip to content

Conversation

@jbsession
Copy link
Owner

This PR adds member promotion screen and resending admin promotions

This PR also includes handling how admins can leave groups.

@jbsession jbsession self-assigned this Nov 19, 2025
onClick = {
(address as? Address.Group)?.let {
navigateTo(ConversationSettingsDestination.RouteManageMembers(it))
navigateTo(ConversationSettingsDestination.RouteManageAdmins(it))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to update the qaTag above by creating a new one so QA can have automated tests linking to this button, because right now you are reusing the manage members one.


val context = LocalContext.current

LaunchedEffect(showingError) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can send toast directly from your viewmodels. This can simplify your logic a lot.

}
LaunchedEffect(showingOngoingAction) {
if (showingOngoingAction != null) {
Toast.makeText(context, showingOngoingAction, Toast.LENGTH_SHORT).show()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can simplify all this logic form the VM as well


LaunchedEffect(uiState.toast) {
if (!uiState.toast.isNullOrEmpty()) {
Toast.makeText(context, uiState.toast, Toast.LENGTH_SHORT).show()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can simplify all this logic form the VM as well

/**
* Shared helper for group operations (same pattern with ManageGroupMembersViewModel).
*/
private fun performGroupOperation(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are starting to re-use this pattern could be extracted somewhere meaningful and re-used?

Copy link
Owner Author

@jbsession jbsession Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, can this be put inside the BaseGroupMemberViewModel as both vm's extend it?

try {
task.await()
} catch (e: CancellationException) {
return@launch

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't return here. You do need to catch it though, but rethrow the error instead of returning.
If you don't catch it here specifically the cancellation will go in the next catch and isn't rethrown which breaks your coroutine lifecycle

Comment on lines 56 to 58
val groupName: StateFlow<String> = groupInfo
.map { it?.first?.name.orEmpty() }
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(), "")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like this name flow is used by multiple viewModels now, should it be moved to the BaseGroupMembersViewModel for reuse?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah makes sense.

@jbsession jbsession closed this Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants