mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-30 20:45:49 +00:00
ios: fix accepting contact request incognito; android, desktop: fix showing incognito auto-accept toggle when short link data is not set (#6026)
* ios: fix accepting contact request incognito * kotlin: fix incognito toggle
This commit is contained in:
@@ -69,7 +69,7 @@ struct ContextContactRequestActionsView: View {
|
||||
private func acceptRequest(incognito: Bool = false) {
|
||||
inProgress = true
|
||||
Task {
|
||||
await acceptContactRequest(incognito: false, contactRequestId: contactRequestId)
|
||||
await acceptContactRequest(incognito: incognito, contactRequestId: contactRequestId)
|
||||
await MainActor.run { inProgress = false }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ object ChatModel {
|
||||
// return true if you handled the click
|
||||
var centerPanelBackgroundClickHandler: (() -> Boolean)? = null
|
||||
|
||||
var addressShortLinkDataSet: Boolean = userAddress.value?.shortLinkDataSet ?: true
|
||||
fun addressShortLinkDataSet(): Boolean = userAddress.value?.shortLinkDataSet ?: true
|
||||
|
||||
fun getUser(userId: Long): User? = if (currentUser.value?.userId == userId) {
|
||||
currentUser.value
|
||||
|
||||
@@ -63,7 +63,7 @@ fun ComposeContextContactRequestActionsView(
|
||||
.fillMaxHeight()
|
||||
.weight(1F)
|
||||
.clickable {
|
||||
if (chatModel.addressShortLinkDataSet) {
|
||||
if (chatModel.addressShortLinkDataSet()) {
|
||||
acceptContactRequest(rhId, incognito = false, contactRequestId, isCurrentUser = true, chatModel)
|
||||
} else {
|
||||
showAcceptRequestAlert(rhId, contactRequestId)
|
||||
|
||||
@@ -523,7 +523,7 @@ fun ContactRequestMenuItems(rhId: Long?, contactRequestId: Long, chatModel: Chat
|
||||
showMenu.value = false
|
||||
}
|
||||
)
|
||||
if (!chatModel.addressShortLinkDataSet) {
|
||||
if (!chatModel.addressShortLinkDataSet()) {
|
||||
ItemAction(
|
||||
stringResource(MR.strings.accept_contact_incognito_button),
|
||||
painterResource(MR.images.ic_theater_comedy),
|
||||
@@ -675,7 +675,7 @@ fun contactRequestAlertDialog(rhId: Long?, contactRequest: ChatInfo.ContactReque
|
||||
}) {
|
||||
Text(generalGetString(MR.strings.accept_contact_button), Modifier.fillMaxWidth(), textAlign = TextAlign.Center, color = MaterialTheme.colors.primary)
|
||||
}
|
||||
if (!chatModel.addressShortLinkDataSet) {
|
||||
if (!chatModel.addressShortLinkDataSet()) {
|
||||
SectionItemView({
|
||||
AlertManager.shared.hideAlert()
|
||||
acceptContactRequest(rhId, incognito = true, contactRequest.apiId, true, chatModel, onSucess)
|
||||
|
||||
@@ -575,7 +575,7 @@ private class AddressSettingsState {
|
||||
@Composable
|
||||
private fun AutoAcceptSection(addressSettingsState: MutableState<AddressSettingsState>) {
|
||||
SectionView(stringResource(MR.strings.auto_accept_contact).uppercase()) {
|
||||
if (!chatModel.addressShortLinkDataSet && !addressSettingsState.value.businessAddress) {
|
||||
if (!chatModel.addressShortLinkDataSet() && !addressSettingsState.value.businessAddress) {
|
||||
AcceptIncognitoToggle(addressSettingsState)
|
||||
}
|
||||
// TODO v6.4.1 show this message editor even with auto-accept disabled
|
||||
|
||||
Reference in New Issue
Block a user