Skip to content

Commit

Permalink
Fix array handling
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Jun 20, 2024
1 parent 8ae8a50 commit 0026f45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ interface IncomingFrameMessage {
modalId: string;
imageURL?: string;
poseURL?: string;
poses?: IOpenposeJson;
poses?: IOpenposeJson | IOpenposeJson[];
};
interface OutgoingFrameMessage {
Expand Down Expand Up @@ -930,7 +930,7 @@ export default defineComponent({
const openposeJson =
message.poseURL?
parseDataURLtoJSON(message.poseURL) as IOpenposeJson:
message.poses!;
Array.isArray(message.poses!) ? message.poses![0] : message.poses!;
this.canvasHeight = openposeJson.canvas_height;
this.canvasWidth = openposeJson.canvas_width;
Expand Down

0 comments on commit 0026f45

Please sign in to comment.