Skip to content

Commit

Permalink
feat: add env settings
Browse files Browse the repository at this point in the history
  • Loading branch information
crazywoola committed Aug 16, 2024
1 parent aa5d839 commit c1cfe1c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion web/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api
NEXT_PUBLIC_SENTRY_DSN=

# Disable Next.js Telemetry (https://nextjs.org/telemetry)
NEXT_TELEMETRY_DISABLED=1
NEXT_TELEMETRY_DISABLED=1

# Disable Upload Image as WebApp icon default is false
NEXT_PUBLIC_UPLOAD_IMAGE_AS_ICON=false
6 changes: 3 additions & 3 deletions web/app/components/base/app-icon-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import s from './style.module.css'
import getCroppedImg from './utils'
import type { AppIconType, ImageFile } from '@/types/app'
import cn from '@/utils/classnames'

import { DISABLE_UPLOAD_IMAGE_AS_ICON } from '@/config'
export type AppIconEmojiSelection = {
type: 'emoji'
icon: string
Expand Down Expand Up @@ -101,7 +101,7 @@ const AppIconPicker: FC<AppIconPickerProps> = ({
wrapperClassName={className}
className={cn(s.container, '!w-[362px] !p-0')}
>
<div className="p-2 pb-0 w-full">
{!DISABLE_UPLOAD_IMAGE_AS_ICON && <div className="p-2 pb-0 w-full">
<div className='p-1 flex items-center justify-center gap-2 bg-background-body rounded-xl'>
{tabs.map(tab => (
<button
Expand All @@ -116,7 +116,7 @@ const AppIconPicker: FC<AppIconPickerProps> = ({
</button>
))}
</div>
</div>
</div>}

<Divider className='m-0' />

Expand Down
2 changes: 2 additions & 0 deletions web/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,5 @@ Thought: {{agent_scratchpad}}
export const VAR_REGEX = /\{\{(#[a-zA-Z0-9_-]{1,50}(\.[a-zA-Z_][a-zA-Z0-9_]{0,29}){1,10}#)\}\}/gi

export const TEXT_GENERATION_TIMEOUT_MS = 60000

export const DISABLE_UPLOAD_IMAGE_AS_ICON = process.env.NEXT_PUBLIC_DISABLE_UPLOAD_IMAGE_AS_ICON === 'true'

0 comments on commit c1cfe1c

Please sign in to comment.