fix(infrared): url-encode profileId in routes and cancel underlying learning deferred

This commit is contained in:
2026-08-25 12:27:54 +08:00
parent 8682f81cb8
commit 3561f3dd4a
2 changed files with 29 additions and 10 deletions
@@ -100,9 +100,10 @@ private fun AuthenticatedNavHost(
actionInProgress = actionInProgress,
errorMessage = errorMessage,
devicesSlot = {
val encodedProfileId = android.net.Uri.encode(profile.id.value)
DeviceListScreen(
onInfraredClick = {
navController.navigate("infrared_remote/${profile.id.value}")
navController.navigate("infrared_remote/$encodedProfileId")
},
)
},
@@ -114,10 +115,11 @@ private fun AuthenticatedNavHost(
navArgument("profileId") { type = NavType.StringType },
),
) {
val encodedProfileId = android.net.Uri.encode(profile.id.value)
InfraredRemoteRoute(
onBack = { navController.popBackStack() },
onOpenSettings = {
navController.navigate("infrared_settings/${profile.id.value}")
navController.navigate("infrared_settings/$encodedProfileId")
},
onSessionInvalid = onLogout,
)