wip
This commit is contained in:
@@ -44,7 +44,8 @@ fun ChatListNavLinkView(chat: Chat, chatModel: ChatModel) {
|
||||
showMenu.value = false
|
||||
delay(500L)
|
||||
}
|
||||
val showChatPreviews = chatModel.controller.appPrefs.privacyShowChatPreviews.get()
|
||||
// TODO repeat stopped
|
||||
val showChatPreviews = remember { mutableStateOf(chatModel.controller.appPrefs.privacyShowChatPreviews.get()) }
|
||||
when (chat.chatInfo) {
|
||||
is ChatInfo.Direct -> {
|
||||
val contactNetworkStatus = chatModel.contactNetworkStatus(chat.chatInfo.contact)
|
||||
@@ -669,7 +670,7 @@ fun PreviewChatListNavLinkDirect() {
|
||||
),
|
||||
chatStats = Chat.ChatStats()
|
||||
),
|
||||
true,
|
||||
remember { mutableStateOf(false) },
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
@@ -709,7 +710,7 @@ fun PreviewChatListNavLinkGroup() {
|
||||
),
|
||||
chatStats = Chat.ChatStats()
|
||||
),
|
||||
true,
|
||||
remember { mutableStateOf(false) },
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
|
||||
@@ -31,7 +31,7 @@ import dev.icerock.moko.resources.ImageResource
|
||||
@Composable
|
||||
fun ChatPreviewView(
|
||||
chat: Chat,
|
||||
showChatPreviews: Boolean,
|
||||
showChatPreviews: MutableState<Boolean>,
|
||||
chatModelDraft: ComposeState?,
|
||||
chatModelDraftChatId: ChatId?,
|
||||
currentUserProfileDisplayName: String?,
|
||||
@@ -141,7 +141,7 @@ fun ChatPreviewView(
|
||||
fun chatPreviewText() {
|
||||
val ci = chat.chatItems.lastOrNull()
|
||||
if (ci != null) {
|
||||
if (showChatPreviews) {
|
||||
if (showChatPreviews.value) {
|
||||
val (text: CharSequence, inlineTextContent) = when {
|
||||
chatModelDraftChatId == chat.id && chatModelDraft != null -> remember(chatModelDraft) { messageDraft(chatModelDraft) }
|
||||
ci.meta.itemDeleted == null -> ci.text to null
|
||||
@@ -339,6 +339,6 @@ fun unreadCountStr(n: Int): String {
|
||||
@Composable
|
||||
fun PreviewChatPreviewView() {
|
||||
SimpleXTheme {
|
||||
ChatPreviewView(Chat.sampleData, true, null, null, "", contactNetworkStatus = NetworkStatus.Connected(), stopped = false, linkMode = SimplexLinkMode.DESCRIPTION)
|
||||
ChatPreviewView(Chat.sampleData, remember { mutableStateOf(false) }, null, null, "", contactNetworkStatus = NetworkStatus.Connected(), stopped = false, linkMode = SimplexLinkMode.DESCRIPTION)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user