Skip to content

Commit

Permalink
fix: app name can be empty in settings modal (#2761)
Browse files Browse the repository at this point in the history
  • Loading branch information
vikeychen authored Mar 9, 2024
1 parent bdc13f9 commit 88145ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/app/components/app/overview/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { SimpleSelect } from '@/app/components/base/select'
import type { AppDetailResponse } from '@/models/app'
import type { Language } from '@/types/app'
import EmojiPicker from '@/app/components/base/emoji-picker'
import { useToastContext } from '@/app/components/base/toast'

import { languages } from '@/i18n/language'

Expand Down Expand Up @@ -42,6 +43,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({
onClose,
onSave,
}) => {
const { notify } = useToastContext()
const [isShowMore, setIsShowMore] = useState(false)
const { icon, icon_background } = appInfo
const { title, description, copyright, privacy_policy, default_language } = appInfo.site
Expand All @@ -67,6 +69,10 @@ const SettingsModal: FC<ISettingsModalProps> = ({
}

const onClickSave = async () => {
if (!inputInfo.title) {
notify({ type: 'error', message: t('app.newApp.nameNotEmpty') })
return
}
setSaveLoading(true)
const params = {
title: inputInfo.title,
Expand Down

0 comments on commit 88145ef

Please sign in to comment.