Fix gif and stickers buttons disappearing after exiting edit.

This commit is contained in:
Greyson Parrelli
2026-02-09 12:30:49 -05:00
committed by Michelle Tang
parent 58d2c92102
commit 38e8f24c20
2 changed files with 17 additions and 0 deletions

View File

@@ -2104,6 +2104,7 @@ class ConversationFragment :
val keyboardMode: TextSecurePreferences.MediaKeyboardMode = TextSecurePreferences.getMediaKeyboardMode(requireContext())
val stickerIntro: Boolean = !TextSecurePreferences.hasSeenStickerIntroTooltip(requireContext())
keyboardPagerViewModel.resetPages()
inputPanel.showMediaKeyboardToggle(true)
val keyboardPage = when (keyboardMode) {

View File

@@ -23,6 +23,22 @@ class KeyboardPagerViewModel : ViewModel() {
pages = DefaultValueLiveData(startingPages)
page = DefaultValueLiveData(startingPages.first())
checkStickerAvailability()
}
fun resetPages() {
val defaultPages: MutableSet<KeyboardPage> = KeyboardPage.entries.toMutableSet()
if (!RemoteConfig.gifSearchAvailable) {
defaultPages.remove(KeyboardPage.GIF)
}
pages.value = defaultPages
checkStickerAvailability()
}
private fun checkStickerAvailability() {
StickerSearchRepository().getStickerFeatureAvailability { available ->
if (!available) {
val updatedPages = pages.value.toMutableSet().apply { remove(KeyboardPage.STICKER) }