Skip to content

Commit

Permalink
Show snackbar on archive/unarchive from bottomDialog
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Hibbe <[email protected]>
  • Loading branch information
mahibi committed Jan 23, 2025
1 parent 77b3e58 commit 589cea9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,25 @@ class ConversationsListBottomDialog(
lifecycleScope.launch {
if (conversation.hasArchived) {
conversationInfoViewModel.unarchiveConversation(currentUser, token)
activity.showSnackbar(
String.format(
context.resources.getString(R.string.unarchived_conversation),
conversation.displayName
)
)
dismiss()
} else {
conversationInfoViewModel.archiveConversation(currentUser, token)
activity.showSnackbar(
String.format(
context.resources.getString(R.string.archived_conversation),
conversation.displayName
)
)
dismiss()
}
}
activity.fetchRooms()
dismiss()
}

binding.conversationOperationRename.setOnClickListener {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -848,4 +848,6 @@ How to translate with transifex:
<string name="user_absence_replacement">Replacement: </string>
<string name="resend_message">Resend</string>
<string name="no_conversations_archived">No conversations archived</string>
<string name="archived_conversation">Archived %1$s</string>
<string name="unarchived_conversation">Unarchived %1$s</string>
</resources>

0 comments on commit 589cea9

Please sign in to comment.