From 1919e234aa9c19e8701befa4e691a8be0d9734e7 Mon Sep 17 00:00:00 2001 From: thekingofcity <3353040+thekingofcity@users.noreply.github.com> Date: Sat, 9 Nov 2024 17:08:17 -0500 Subject: [PATCH] #875 Update app metadata on importing work from gallery --- src/components/page-header/open-actions.tsx | 2 +- src/components/page-header/rmp-gallery-app-clip.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/page-header/open-actions.tsx b/src/components/page-header/open-actions.tsx index 68e5c77e4..d417c65ea 100644 --- a/src/components/page-header/open-actions.tsx +++ b/src/components/page-header/open-actions.tsx @@ -64,7 +64,7 @@ export default function OpenActions() { // details panel will complain about unknown nodes or edges if the last selected is not cleared dispatch(clearSelected()); - // rest graph with new data + // reset graph with new data graph.current.clear(); graph.current.import(save.graph); diff --git a/src/components/page-header/rmp-gallery-app-clip.tsx b/src/components/page-header/rmp-gallery-app-clip.tsx index cc185101f..084962f55 100644 --- a/src/components/page-header/rmp-gallery-app-clip.tsx +++ b/src/components/page-header/rmp-gallery-app-clip.tsx @@ -57,7 +57,7 @@ export default function RmpGalleryAppClip(props: RmpGalleryAppClipProps) { // details panel will complain about unknown nodes or edges if the last selected is not cleared dispatch(clearSelected()); - // rest graph with new data + // reset graph with new data graph.current.clear(); graph.current.import(save.graph); @@ -124,6 +124,8 @@ export default function RmpGalleryAppClip(props: RmpGalleryAppClipProps) { let host: string | undefined = undefined; if (firstDotIndex !== -1) host = params.substring(firstDotIndex + 1); fetchAndApplyTemplate(id, host); + // clear the search params in rmt, otherwise it will be preserved and re-imported every time + rmgRuntime.updateAppMetadata({}); } }, []);