Skip to content

Commit

Permalink
feat: support non-edit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
plutoless committed Dec 25, 2024
1 parent 837374a commit 11903bb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion playground/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
AGENT_SERVER_URL=http://localhost:8080
TEN_DEV_SERVER_URL=http://localhost:49483
TEN_DEV_SERVER_URL=http://localhost:49483
EDIT_GRAPH_MODE=true
3 changes: 1 addition & 2 deletions playground/src/common/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,4 @@ export const isLLM = (extensionName: string) => {
return extensionName === "llm" || extensionName === "v2v";
}

// export const isProduction = process.env.NODE_ENV === "production";
export const isProduction = true;
export const isEditModeOn = process.env.EDIT_GRAPH_MODE === "true";
4 changes: 2 additions & 2 deletions playground/src/components/Chat/ChatCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
useAppSelector,
GRAPH_OPTIONS,
isRagGraph,
isProduction,
isEditModeOn,
} from "@/common";
import {
setRtmConnected,
Expand Down Expand Up @@ -113,7 +113,7 @@ export default function ChatCard(props: { className?: string }) {
<div className="flex w-full flex-wrap items-center justify-end gap-x-2 gap-y-2">
<RemoteGraphSelect />
{
!isProduction ? (
isEditModeOn ? (
<>
<RemoteModuleCfgSheet />
<RemotePropertyCfgSheet />
Expand Down
4 changes: 2 additions & 2 deletions playground/src/store/reducers/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
EMobileActiveTab,
DEFAULT_OPTIONS,
COLOR_LIST,
isProduction
isEditModeOn
} from "@/common/constant";
import {
apiReloadPackage,
Expand Down Expand Up @@ -177,7 +177,7 @@ let initializeGraphData;
// Fetch graph details
let fetchGraphDetails;

if (!isProduction) {
if (isEditModeOn) {
// only for development, below requests depend on dev-server
initializeGraphData = createAsyncThunk(
"global/initializeGraphData",
Expand Down

0 comments on commit 11903bb

Please sign in to comment.