Skip to content

Commit

Permalink
Only show spinner in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
arcticfly committed Mar 27, 2023
1 parent 3cbe84d commit 0ef37a2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DEBUG_MODE=true
6 changes: 4 additions & 2 deletions src/common/RunTaskButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ChatIcon } from '@chakra-ui/icons';
import { Button, HStack, Icon, Spacer, Spinner } from '@chakra-ui/react';
import React from 'react';
import { useAppState } from '../state/store';
import { BsPlayFill, BsStopFill } from 'react-icons/bs';
import { debugMode } from '../constants';

export default function RunTaskButton(props: { runTask: () => void }) {
const state = useAppState((state) => ({
Expand Down Expand Up @@ -38,7 +38,9 @@ export default function RunTaskButton(props: { runTask: () => void }) {
<HStack alignItems="center">
{button}
<Spacer />
{state.taskState === 'running' && <Spinner color="blue.500" />}
{debugMode && state.taskState === 'running' && (
<Spinner color="blue.500" />
)}
</HStack>
);
}
3 changes: 3 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export const WEBAGENT_ELEMENT_SELECTOR = 'data-webagent-node-id';

// read from env
export const debugMode = process.env.DEBUG_MODE === 'true';

0 comments on commit 0ef37a2

Please sign in to comment.