Skip to content

Commit a775e0e

Browse files
committed
refactor: Make location pin user-editable via QuickChat
Remove hardcoded location action. Users can now create their own QuickChat action with %GPS variable which will be replaced with actual coordinates. Example: Create QuickChat action with message 'https://maps.google.com/?q=%GPS' and it expands to 'https://maps.google.com/?q=25.7987898,-80.3939333' This allows users to: - Edit the action name (emoji) - Change between Append/Instant mode - Modify the URL or message format - Reorder actions - Delete if not needed
1 parent d28de35 commit a775e0e

File tree

1 file changed

+1
-17
lines changed
  • feature/messaging/src/main/kotlin/org/meshtastic/feature/messaging

1 file changed

+1
-17
lines changed

feature/messaging/src/main/kotlin/org/meshtastic/feature/messaging/Message.kt

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -722,23 +722,7 @@ private fun QuickChatRow(
722722
)
723723
}
724724

725-
val locationAction =
726-
remember(userLatitude, userLongitude) {
727-
if (userLatitude != null && userLongitude != null) {
728-
QuickChatAction(
729-
name = "📍",
730-
message = "https://maps.google.com/?q=%GPS",
731-
mode = QuickChatAction.Mode.Append,
732-
position = -2,
733-
)
734-
} else {
735-
null
736-
}
737-
}
738-
739-
val allActions = remember(alertAction, locationAction, actions) {
740-
listOfNotNull(alertAction, locationAction) + actions
741-
}
725+
val allActions = remember(alertAction, actions) { listOf(alertAction) + actions }
742726

743727
LazyRow(modifier = modifier.padding(vertical = 4.dp), horizontalArrangement = Arrangement.spacedBy(4.dp)) {
744728
items(allActions, key = { it.position }) { action ->

0 commit comments

Comments
 (0)