From 79d7d4ad4b4e5d48888ffad253f7e15730cc73f6 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Fri, 8 Dec 2023 15:51:42 -0300 Subject: [PATCH] fix(shareModal/index.tsx): make handleShareComponent function asynchronous to ensure proper flow saving before saving flow store --- src/frontend/src/modals/shareModal/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/modals/shareModal/index.tsx b/src/frontend/src/modals/shareModal/index.tsx index 34c1b5a31..e64c650d4 100644 --- a/src/frontend/src/modals/shareModal/index.tsx +++ b/src/frontend/src/modals/shareModal/index.tsx @@ -92,7 +92,7 @@ export default function ShareModal({ setDescription(component?.description ?? ""); }, [component, open, internalOpen]); - const handleShareComponent = () => { + const handleShareComponent = async () => { //remove file names from flows before sharing removeFileNameFromComponents(component); const flow: FlowType = checked @@ -113,7 +113,7 @@ export default function ShareModal({ is_component: is_component, }); - saveFlow(flows.find((flow) => flow.id === tabId)!, true); + await saveFlow(flows.find((flow) => flow.id === tabId)!, true); saveFlowStore(flow!, getTagsIds(selectedTags, tags), sharePublic).then( () => {