Skip to content

Commit 539544c

Browse files
committed
Added build:view in package.json, changed viewModeTriple.
1 parent dce2707 commit 539544c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"start:ee": "REACT_APP_EDITION=enterprise yarn workspace lowcoder start",
1616
"translate": "node --loader ts-node/esm ./scripts/translate.js",
1717
"build": "yarn node ./scripts/build.js",
18+
"build:view": "REACT_APP_VIEW_MODE=view yarn workspace lowcoder build",
1819
"test": "jest && yarn workspace lowcoder-comps test",
1920
"prepare": "yarn workspace lowcoder prepare",
2021
"build:core": "yarn workspace lowcoder-core build",

client/packages/lowcoder-sdk/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
},
3030
"scripts": {
3131
"build": "NODE_OPTIONS=--max_old_space_size=6442 vite build",
32-
"start": "NODE_OPTIONS=--max_old_space_size=2048 vite"
32+
"start": "NODE_OPTIONS=--max_old_space_size=2048 vite",
33+
"build:view": "REACT_APP_VIEW_MODE=view yarn build"
3334
},
3435
"devDependencies": {
3536
"@rollup/plugin-commonjs": "^22.0.2",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const viewMode = () => REACT_APP_VIEW_MODE;
2-
export const viewModeTriple = () => window.location.href.includes("view") ? "view" : window.location.href.includes("edit") ? "edit" : "admin";
2+
export const viewModeTriple = () => viewMode() === "view" ? "view" : window.location.href.includes("edit") ? "edit" : "admin";
33
export const getLanguage = (): string => {
44
return localStorage.getItem('lowcoder_uiLanguage') || 'en';
55
}

0 commit comments

Comments
 (0)