diff --git a/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/unmanned/passenger/ui/aiview/PNCActionsViewModel.kt b/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/unmanned/passenger/ui/aiview/PNCActionsViewModel.kt index 5df4483fa1..b8d9288554 100644 --- a/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/unmanned/passenger/ui/aiview/PNCActionsViewModel.kt +++ b/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/unmanned/passenger/ui/aiview/PNCActionsViewModel.kt @@ -16,6 +16,8 @@ class PNCActionsViewModel: ViewModel(), IMoGoAutopilotPlanningActionsListener { private const val TAG = "PNCActionsViewModel" } + private var currentAction = "" + fun init(){ CallerPlanningActionsListenerManager.addListener(TAG, this) } @@ -49,9 +51,12 @@ class PNCActionsViewModel: ViewModel(), IMoGoAutopilotPlanningActionsListener { ) } // update view - if(actions?.isNotEmpty() == true){ - val action = AIMessage.PNCAction(actions!!,actions!!) - AIMessageManager.post(action) + actions?.let { + if(it.isNotEmpty() && it != currentAction){ + currentAction = it + val action = AIMessage.PNCAction(it+System.currentTimeMillis(),it) + AIMessageManager.post(action) + } } }