File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
client/packages/lowcoder/src/comps Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { logoutAction } from "redux/reduxActions/userActions";
1010import StoreRegistry from "@lowcoder-ee/redux/store/storeRegistry" ;
1111import UserApi from "@lowcoder-ee/api/userApi" ;
1212import { messageInstance } from "components/GlobalInstances" ;
13+ import { isEditMode } from "../utils/globalSettings" ;
1314
1415const UtilsCompBase = simpleMultiComp ( { } ) ;
1516export let UtilsComp = withExposingConfigs ( UtilsCompBase , [ ] ) ;
@@ -30,6 +31,16 @@ interface DownloadFileOptions {
3031}
3132
3233UtilsComp = withMethodExposing ( UtilsComp , [
34+ {
35+ method : {
36+ name : "isEditMode" ,
37+ description : trans ( "utilsComp.isEditMode" ) ,
38+ params : [ ] ,
39+ } ,
40+ execute : ( comp , params ) => {
41+ return isEditMode ( ) ;
42+ } ,
43+ } ,
3344 {
3445 method : {
3546 name : "openUrl" ,
Original file line number Diff line number Diff line change @@ -19,3 +19,9 @@ export function setGlobalSettings(patch: GlobalSettings) {
1919export function getGlobalSettings ( ) {
2020 return globalSettings ;
2121}
22+
23+
24+ export function isEditMode ( ) : boolean {
25+ // Edit mode is when we're not in view mode
26+ return globalSettings . isViewMode !== true ;
27+ }
You can’t perform that action at this time.
0 commit comments