From 77ab27373e744aa40df2f56491b3cb7d717188ce Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Fri, 10 Nov 2023 21:48:31 -0500 Subject: [PATCH] Update workflowEditorCommentStore set/del for vue3 --- .../src/stores/workflowEditorCommentStore.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/client/src/stores/workflowEditorCommentStore.ts b/client/src/stores/workflowEditorCommentStore.ts index 414482dccf64..d5f97c365b47 100644 --- a/client/src/stores/workflowEditorCommentStore.ts +++ b/client/src/stores/workflowEditorCommentStore.ts @@ -1,5 +1,5 @@ import { defineStore } from "pinia"; -import { computed, del, ref, set } from "vue"; +import { computed, ref } from "vue"; import type { Color } from "@/components/Workflow/Editor/Comments/colors"; import { @@ -112,7 +112,7 @@ export const useWorkflowCommentStore = (workflowId: string) => { newComment.position[0] += defaultPosition[0]; newComment.position[1] += defaultPosition[1]; - set(commentsRecord.value, newComment.id, newComment); + commentsRecord.value[newComment.id] = newComment; }); }; @@ -128,23 +128,23 @@ export const useWorkflowCommentStore = (workflowId: string) => { function changePosition(id: number, position: [number, number]) { const comment = getComment.value(id); - set(comment, "position", vecReduceFigures(position)); + comment.position = vecReduceFigures(position); } function changeSize(id: number, size: [number, number]) { const comment = getComment.value(id); - set(comment, "size", vecReduceFigures(size)); + comment.size = vecReduceFigures(size); } function changeData(id: number, data: unknown) { const comment = getComment.value(id); assertCommentDataValid(comment.type, data); - set(comment, "data", data); + comment.data = data; } function changeColor(id: number, color: WorkflowCommentColor) { const comment = getComment.value(id); - set(comment, "color", color); + comment.color = color; } function addPoint(id: number, point: [number, number]) { @@ -165,7 +165,7 @@ export const useWorkflowCommentStore = (workflowId: string) => { } function deleteComment(id: number) { - del(commentsRecord.value, id); + delete commentsRecord.value[id]; } /** @@ -182,9 +182,9 @@ export const useWorkflowCommentStore = (workflowId: string) => { const metadata = localCommentsMetadata.value[id]; if (metadata) { - set(metadata, "justCreated", true); + metadata.justCreated = true; } else { - set(localCommentsMetadata.value, id, { justCreated: true }); + localCommentsMetadata.value[id] = { justCreated: true }; } } @@ -192,7 +192,7 @@ export const useWorkflowCommentStore = (workflowId: string) => { const metadata = localCommentsMetadata.value[id]; if (metadata) { - del(metadata, "justCreated"); + delete metadata.justCreated; } }