From e9f685e5e4bd934b803bf4aea5e43c3ea485f270 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Sun, 27 Apr 2025 16:19:20 +0800 Subject: [PATCH] =?UTF-8?q?[8.0.0]PNCActions=E8=BF=9BMogoMind=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../passenger/ui/aiview/PNCActionsViewModel.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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) + } } }