mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 06:22:43 +00:00
desktop: hide SimpleX address and chat preferences rows with no profile and no mobile in use (#7717)
This commit is contained in:
1 parent
000258224c
commit
23ca3ea42f
4 files changed
+81
-29
No files matched your search
+29
-27
@@ -217,41 +217,43 @@ fun UserPicker(
|
||||
|
||||
@Composable
|
||||
fun SecondSection() {
|
||||
UserPickerOptionRow(
|
||||
painterResource(MR.images.ic_qr_code),
|
||||
if (chatModel.userAddress.value != null) generalGetString(MR.strings.your_simplex_contact_address) else generalGetString(MR.strings.create_simplex_address),
|
||||
showCustomModal { it, close ->
|
||||
val user = it.currentUser.value
|
||||
if (user != null) {
|
||||
UserAddressView(it, shareViaProfile = user.addressShared, close = close)
|
||||
} else {
|
||||
val modal = this
|
||||
LaunchedEffect(modal, ModalManager.start.modalCount.value) {
|
||||
if (ModalManager.start.isLastModal(modal)) close()
|
||||
}
|
||||
}
|
||||
}, disabled = stopped
|
||||
)
|
||||
UserPickerOptionRow(
|
||||
painterResource(MR.images.ic_toggle_on),
|
||||
stringResource(MR.strings.chat_preferences),
|
||||
click = if (stopped) null else ({
|
||||
showCustomModal { m, close ->
|
||||
val user = m.currentUser.value
|
||||
if (!chatModel.desktopNoUserNoRemote) {
|
||||
UserPickerOptionRow(
|
||||
painterResource(MR.images.ic_qr_code),
|
||||
if (chatModel.userAddress.value != null) generalGetString(MR.strings.your_simplex_contact_address) else generalGetString(MR.strings.create_simplex_address),
|
||||
showCustomModal { it, close ->
|
||||
val user = it.currentUser.value
|
||||
if (user != null) {
|
||||
PreferencesView(m, user, close)
|
||||
UserAddressView(it, shareViaProfile = user.addressShared, close = close)
|
||||
} else {
|
||||
val modal = this
|
||||
LaunchedEffect(modal, ModalManager.start.modalCount.value) {
|
||||
if (ModalManager.start.isLastModal(modal)) close()
|
||||
}
|
||||
}
|
||||
}()
|
||||
}),
|
||||
disabled = stopped
|
||||
)
|
||||
}, disabled = stopped
|
||||
)
|
||||
UserPickerOptionRow(
|
||||
painterResource(MR.images.ic_toggle_on),
|
||||
stringResource(MR.strings.chat_preferences),
|
||||
click = if (stopped) null else ({
|
||||
showCustomModal { m, close ->
|
||||
val user = m.currentUser.value
|
||||
if (user != null) {
|
||||
PreferencesView(m, user, close)
|
||||
} else {
|
||||
val modal = this
|
||||
LaunchedEffect(modal, ModalManager.start.modalCount.value) {
|
||||
if (ModalManager.start.isLastModal(modal)) close()
|
||||
}
|
||||
}
|
||||
}()
|
||||
}),
|
||||
disabled = stopped
|
||||
)
|
||||
}
|
||||
if (appPlatform.isDesktop) {
|
||||
Divider(Modifier.padding(DEFAULT_PADDING))
|
||||
if (!chatModel.desktopNoUserNoRemote) Divider(Modifier.padding(DEFAULT_PADDING))
|
||||
|
||||
val inactiveUsers = users.filter { !it.user.activeUser }
|
||||
|
||||
|
||||
Reference in new issue
Block a user