@@ -13,7 +13,7 @@ import { trans, transToNode } from "i18n";
13
13
import { exportApplicationAsJSONFile } from "pages/ApplicationV2/components/AppImport" ;
14
14
import { useContext , useMemo , useState } from "react" ;
15
15
import { useDispatch , useSelector } from "react-redux" ;
16
- import { currentApplication } from "redux/selectors/applicationSelector" ;
16
+ import { currentApplication , isPublicApplication } from "redux/selectors/applicationSelector" ;
17
17
import { showAppSnapshotSelector } from "redux/selectors/appSnapshotSelector" ;
18
18
import styled from "styled-components" ;
19
19
import history from "util/history" ;
@@ -74,9 +74,10 @@ export function HeaderStartDropdown(props: { setEdit: () => void, isViewMarketpl
74
74
const showAppSnapshot = useSelector ( showAppSnapshotSelector ) ;
75
75
const applicationId = useApplicationId ( ) ;
76
76
const application = useSelector ( currentApplication ) ;
77
+ const isPublicApp = useSelector ( isPublicApplication ) ;
77
78
const [ showCopyModal , setShowCopyModal ] = useState ( false ) ;
78
79
const dispatch = useDispatch ( ) ;
79
- const { appType } = useContext ( ExternalEditorContext ) ;
80
+ const { appType, exportPublicAppToJson } = useContext ( ExternalEditorContext ) ;
80
81
const isModule = appType === AppTypeEnum . Module ;
81
82
82
83
const isEditable = canEditApp ( user , application ) ;
@@ -137,6 +138,9 @@ export function HeaderStartDropdown(props: { setEdit: () => void, isViewMarketpl
137
138
if ( e . key === "edit" ) {
138
139
props . setEdit ( ) ;
139
140
} else if ( e . key === "export" ) {
141
+ if ( isPublicApp && exportPublicAppToJson ) {
142
+ return exportPublicAppToJson ?.( ) ;
143
+ }
140
144
exportApplicationAsJSONFile ( applicationId ) ;
141
145
} else if ( e . key === "duplicate" ) {
142
146
setShowCopyModal ( true ) ;
0 commit comments