Fix location being added to note even after deselecting it

This commit is contained in:
greenart7c3
2025-10-31 06:34:49 -03:00
parent 3c7104fb6a
commit bdb2637803
4 changed files with 4 additions and 4 deletions

View File

@@ -441,7 +441,7 @@ class ChatNewMessageViewModel :
val urls = findURLs(message.text)
val usedAttachments = iMetaAttachments.filterIsIn(urls.toSet())
val emojis = findEmoji(message.text, accountViewModel.account.emoji.myEmojis.value)
val geoHash = (location?.value as? LocationState.LocationResult.Success)?.geoHash?.toString()
val geoHash = if (wantsToAddGeoHash) (location?.value as? LocationState.LocationResult.Success)?.geoHash?.toString() else null
val message = message.text
val contentWarningReason = if (wantsToMarkAsSensitive) "" else null

View File

@@ -385,7 +385,7 @@ open class ChannelNewMessageViewModel :
val emojis = findEmoji(message.text, accountViewModel.account.emoji.myEmojis.value)
val channelRelays = channel.relays()
val geoHash = (location?.value as? LocationState.LocationResult.Success)?.geoHash?.toString()
val geoHash = if (wantsToAddGeoHash) (location?.value as? LocationState.LocationResult.Success)?.geoHash?.toString() else null
return if (channel is PublicChatChannel) {
val replyingToEvent = replyTo.value?.toEventHint<ChannelMessageEvent>()

View File

@@ -327,7 +327,7 @@ open class NewProductViewModel :
val urls = findURLs(tagger.message)
val usedAttachments = iMetaDescription.filterIsIn(urls.toSet()) + productImages.map { it.toIMeta() }
val geoHash = (location?.value as? LocationState.LocationResult.Success)?.geoHash?.toString()
val geoHash = if (wantsToAddGeoHash) (location?.value as? LocationState.LocationResult.Success)?.geoHash?.toString() else null
val zapReceiver = if (wantsForwardZapTo) forwardZapTo.value.toZapSplitSetup() else null
val localZapRaiserAmount = if (wantsZapraiser) zapRaiserAmount.value else null

View File

@@ -515,7 +515,7 @@ open class ShortNotePostViewModel :
val zapReceiver = if (wantsForwardZapTo) forwardZapTo.value.toZapSplitSetup() else null
val geoHash = (location?.value as? LocationState.LocationResult.Success)?.geoHash?.toString()
val geoHash = if (wantsToAddGeoHash) (location?.value as? LocationState.LocationResult.Success)?.geoHash?.toString() else null
val localZapRaiserAmount = if (wantsZapRaiser) zapRaiserAmount.value else null
val emojis = findEmoji(tagger.message, account.emoji.myEmojis.value)