feat #2810 - fix export config file name (#3000)

This commit is contained in:
DaneEvans 2025-09-07 00:40:37 +10:00 committed by GitHub
parent 266379c979
commit 93e7eb3aa0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -135,11 +135,15 @@ fun SettingsScreen(
viewModel.installProfile(it)
} else {
deviceProfile = it
val nodeName = it.shortName.ifBlank { "node" }
val dateFormat = java.text.SimpleDateFormat("yyyyMMdd", java.util.Locale.getDefault())
val dateStr = dateFormat.format(java.util.Date())
val fileName = "Meshtastic_${nodeName}_${dateStr}_nodeConfig.cfg"
val intent =
Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
addCategory(Intent.CATEGORY_OPENABLE)
type = "application/*"
putExtra(Intent.EXTRA_TITLE, "device_profile.cfg")
putExtra(Intent.EXTRA_TITLE, fileName)
}
exportConfigLauncher.launch(intent)
}