Adds hidden notes to chat.

This commit is contained in:
Vitor Pamplona
2023-02-04 19:41:19 -05:00
parent e3d7c23218
commit ea9ff08d8a

View File

@@ -59,14 +59,27 @@ fun ChatroomMessageCompose(baseNote: Note, routeForLastRead: String?, innerQuote
val accountState by accountViewModel.accountLiveData.observeAsState() val accountState by accountViewModel.accountLiveData.observeAsState()
val account = accountState?.account ?: return val account = accountState?.account ?: return
val noteReportsState by baseNote.liveReports.observeAsState()
val noteForReports = noteReportsState?.note ?: return
val accountUser = account.userProfile() val accountUser = account.userProfile()
var popupExpanded by remember { mutableStateOf(false) } var popupExpanded by remember { mutableStateOf(false) }
var showHiddenNote by remember { mutableStateOf(false) }
val context = LocalContext.current.applicationContext val context = LocalContext.current.applicationContext
if (note?.event == null) { if (note?.event == null) {
BlankNote(Modifier) BlankNote(Modifier)
} else if (!account.isAcceptable(noteForReports) && !showHiddenNote) {
HiddenNote(
account.getRelevantReports(noteForReports),
account.userProfile(),
Modifier,
innerQuote,
navController,
onClick = { showHiddenNote = true }
)
} else { } else {
var backgroundBubbleColor: Color var backgroundBubbleColor: Color
var alignment: Arrangement.Horizontal var alignment: Arrangement.Horizontal