diff --git a/app/src/main/java/com/kylecorry/trail_sense/navigation/paths/infrastructure/persistence/PathService.kt b/app/src/main/java/com/kylecorry/trail_sense/navigation/paths/infrastructure/persistence/PathService.kt index 0eabe77c1..85d7f7518 100644 --- a/app/src/main/java/com/kylecorry/trail_sense/navigation/paths/infrastructure/persistence/PathService.kt +++ b/app/src/main/java/com/kylecorry/trail_sense/navigation/paths/infrastructure/persistence/PathService.kt @@ -158,11 +158,12 @@ class PathService( val backtrackId = getBacktrackPathId() val wasBacktrack = start.id == backtrackId || end.id == backtrackId val style = start.style - val name = start.name + val name = start.name ?: end.name + val parentId = start.parentId val startPoints = getWaypoints(startPathId) val endPoints = getWaypoints(endPathId) - val newPathId = addPath(getEmptyPath(false).copy(name = name, style = style)) + val newPathId = addPath(getEmptyPath(false).copy(name = name, style = style, parentId = parentId)) val allPoints = (startPoints + endPoints).map { it.copy(id = 0)