This is an automated email from the ASF dual-hosted git repository.

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git


The following commit(s) were added to refs/heads/main by this push:
     new a0783465 Fix #729
a0783465 is described below

commit a0783465c1ca45b6570cfa0051e3b13e02ad2e85
Author: Marat Gubaidullin <marat.gubaidul...@gmail.com>
AuthorDate: Tue Apr 18 18:56:16 2023 -0400

    Fix #729
---
 karavan-app/src/main/webui/src/projects/ProjectPage.tsx | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/karavan-app/src/main/webui/src/projects/ProjectPage.tsx 
b/karavan-app/src/main/webui/src/projects/ProjectPage.tsx
index afced74a..efbaaff4 100644
--- a/karavan-app/src/main/webui/src/projects/ProjectPage.tsx
+++ b/karavan-app/src/main/webui/src/projects/ProjectPage.tsx
@@ -33,6 +33,7 @@ import {CamelDefinitionYaml} from 
"karavan-core/lib/api/CamelDefinitionYaml";
 import {ProjectPageToolbar} from "./ProjectPageToolbar";
 import {ProjectFilesTable} from "./ProjectFilesTable";
 import {TemplateApi} from "karavan-core/lib/api/TemplateApi";
+import {EventBus} from "../designer/utils/EventBus";
 
 interface Props {
     project: Project,
@@ -40,7 +41,6 @@ interface Props {
 }
 
 interface State {
-    karavanDesignerRef: any,
     project?: Project,
     file?: ProjectFile,
     files: ProjectFile[],
@@ -59,7 +59,6 @@ interface State {
 export class ProjectPage extends React.Component<Props, State> {
 
     public state: State = {
-        karavanDesignerRef: React.createRef(),
         project: this.props.project,
         isUploadModalOpen: false,
         isCreateModalOpen: false,
@@ -166,9 +165,7 @@ export class ProjectPage extends React.Component<Props, 
State> {
     }
 
     downloadImage = () => {
-        if (this.state.karavanDesignerRef) {
-            this.state.karavanDesignerRef.current.downloadImage();
-        }
+        EventBus.sendCommand("downloadImage");
     }
 
     addProperty() {
@@ -269,7 +266,6 @@ export class ProjectPage extends React.Component<Props, 
State> {
         return (
             file !== undefined &&
             <KaravanDesigner
-                ref={this.state.karavanDesignerRef}
                 dark={false}
                 key={"key"}
                 filename={file.name}

Reply via email to