Skip to content

Commit

Permalink
Merge branch 'develop' into feat/disable_performance_tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
borichellow committed Feb 7, 2025
2 parents c48a8d6 + 94bd1dc commit 4418f2d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ internal fun ConversationMainSheetContent(
}
}
}
if (moveConversationToFolder != null) {
if (moveConversationToFolder != null && !conversationSheetContent.isArchived) {
add {
MenuBottomSheetItem(
leading = {
Expand All @@ -168,7 +168,7 @@ internal fun ConversationMainSheetContent(
)
}
}
if (conversationSheetContent.folder != null) {
if (conversationSheetContent.folder != null && !conversationSheetContent.isArchived) {
add {
MenuBottomSheetItem(
leading = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ data class ConversationFoldersNavArgs(

@Parcelize
data class ConversationFoldersNavBackArgs(val message: String) : Parcelable

@Parcelize
data class NewConversationFolderNavBackArgs(
val folderName: String,
val folderId: String
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import com.wire.android.ui.common.topappbar.WireCenterAlignedTopAppBar
import com.wire.android.ui.common.typography
import com.wire.android.ui.destinations.NewConversationFolderScreenDestination
import com.wire.kalium.logic.data.conversation.ConversationFolder
import com.wire.kalium.logic.data.conversation.FolderType

@RootNavGraph
@WireDestination(
Expand All @@ -70,7 +71,7 @@ fun ConversationFoldersScreen(
args: ConversationFoldersNavArgs,
navigator: Navigator,
resultNavigator: ResultBackNavigator<ConversationFoldersNavBackArgs>,
resultRecipient: ResultRecipient<NewConversationFolderScreenDestination, String>,
resultRecipient: ResultRecipient<NewConversationFolderScreenDestination, NewConversationFolderNavBackArgs>,
foldersViewModel: ConversationFoldersVM =
hiltViewModel<ConversationFoldersVMImpl, ConversationFoldersVMImpl.Factory>(
creationCallback = { it.create(ConversationFoldersStateArgs(args.currentFolderId)) }
Expand Down Expand Up @@ -104,7 +105,13 @@ fun ConversationFoldersScreen(
when (it) {
NavResult.Canceled -> {}
is NavResult.Value -> {
foldersViewModel.onFolderSelected(it.value)
moveToFolderVM.moveConversationToFolder(
ConversationFolder(
it.value.folderId,
it.value.folderName,
FolderType.USER
)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,18 @@ import com.wire.android.util.ui.SnackBarMessageHandler
@Composable
fun NewConversationFolderScreen(
navigator: Navigator,
resultNavigator: ResultBackNavigator<String>,
resultNavigator: ResultBackNavigator<NewConversationFolderNavBackArgs>,
viewModel: NewFolderViewModel = hiltViewModel()
) {

LaunchedEffect(viewModel.folderNameState.folderId) {
if (viewModel.folderNameState.folderId != null) {
resultNavigator.navigateBack(viewModel.folderNameState.folderId!!)
resultNavigator.navigateBack(
NewConversationFolderNavBackArgs(
viewModel.textState.text.toString(),
viewModel.folderNameState.folderId!!
)
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ class MessageCompositionHolder(
appLogger.e("MessageCompositionHolder: Failure to add mention")
return
}
insertMentionIntoText(mention)
messageComposition.update {
it.copy(
selectedMentions = it.selectedMentions.plus(mention).sortedBy { it.start }
)
}
insertMentionIntoText(mention)
}

private fun insertMentionIntoText(mention: UIMention) {
Expand Down

0 comments on commit 4418f2d

Please sign in to comment.