Unverified Commit 88145efa authored by Vikey Chen's avatar Vikey Chen Committed by GitHub

fix: app name can be empty in settings modal (#2761)

parent bdc13f92
...@@ -12,6 +12,7 @@ import { SimpleSelect } from '@/app/components/base/select' ...@@ -12,6 +12,7 @@ import { SimpleSelect } from '@/app/components/base/select'
import type { AppDetailResponse } from '@/models/app' import type { AppDetailResponse } from '@/models/app'
import type { Language } from '@/types/app' import type { Language } from '@/types/app'
import EmojiPicker from '@/app/components/base/emoji-picker' import EmojiPicker from '@/app/components/base/emoji-picker'
import { useToastContext } from '@/app/components/base/toast'
import { languages } from '@/i18n/language' import { languages } from '@/i18n/language'
...@@ -42,6 +43,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({ ...@@ -42,6 +43,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({
onClose, onClose,
onSave, onSave,
}) => { }) => {
const { notify } = useToastContext()
const [isShowMore, setIsShowMore] = useState(false) const [isShowMore, setIsShowMore] = useState(false)
const { icon, icon_background } = appInfo const { icon, icon_background } = appInfo
const { title, description, copyright, privacy_policy, default_language } = appInfo.site const { title, description, copyright, privacy_policy, default_language } = appInfo.site
...@@ -67,6 +69,10 @@ const SettingsModal: FC<ISettingsModalProps> = ({ ...@@ -67,6 +69,10 @@ const SettingsModal: FC<ISettingsModalProps> = ({
} }
const onClickSave = async () => { const onClickSave = async () => {
if (!inputInfo.title) {
notify({ type: 'error', message: t('app.newApp.nameNotEmpty') })
return
}
setSaveLoading(true) setSaveLoading(true)
const params = { const params = {
title: inputInfo.title, title: inputInfo.title,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment