mirror of
https://github.com/soconnor0919/hristudio.git
synced 2026-05-08 13:58:55 -04:00
fix: handle namespaced action IDs in animation execution
This commit is contained in:
@@ -218,15 +218,19 @@ export class RobotCommunicationService extends EventEmitter {
|
|||||||
): void {
|
): void {
|
||||||
const { implementation, parameters, actionId: actionType } = action;
|
const { implementation, parameters, actionId: actionType } = action;
|
||||||
|
|
||||||
// Use SSH for play_animation actions
|
// Use SSH for play_animation actions (check both namespaced and non-namespaced)
|
||||||
if (actionType.startsWith("play_animation_")) {
|
const baseActionId = actionType.includes(".")
|
||||||
this.executeAnimationViaSSH(actionType).then(() => {
|
? actionType.split(".").pop()
|
||||||
|
: actionType;
|
||||||
|
|
||||||
|
if (baseActionId?.startsWith("play_animation_")) {
|
||||||
|
this.executeAnimationViaSSH(baseActionId).then(() => {
|
||||||
this.completeAction(actionId, {
|
this.completeAction(actionId, {
|
||||||
success: true,
|
success: true,
|
||||||
duration:
|
duration:
|
||||||
Date.now() -
|
Date.now() -
|
||||||
(this.pendingActions.get(actionId)?.startTime || Date.now()),
|
(this.pendingActions.get(actionId)?.startTime || Date.now()),
|
||||||
data: { method: "ssh", action: actionType },
|
data: { method: "ssh", action: baseActionId },
|
||||||
});
|
});
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.pendingActions.get(actionId)?.reject(error);
|
this.pendingActions.get(actionId)?.reject(error);
|
||||||
|
|||||||
Reference in New Issue
Block a user