fix: remove rename check

This commit is contained in:
Joel 2024-04-02 18:12:44 +08:00
parent 2d7c43b60f
commit 59d279fbe0
1 changed files with 9 additions and 7 deletions

View File

@ -87,13 +87,15 @@ const ConfigModal: FC<IConfigModalProps> = ({
Toast.notify({ type: 'error', message: t('appDebug.variableConig.errorMsg.varNameRequired') })
return
}
if (varKeys.map(key => key?.trim()).includes(tempPayload.variable.trim())) {
Toast.notify({
type: 'error',
message: t('appDebug.varKeyError.keyAlreadyExists', { key: tempPayload.variable }),
})
return
}
// TODO: check if key already exists. should the consider the edit case
// if (varKeys.map(key => key?.trim()).includes(tempPayload.variable.trim())) {
// Toast.notify({
// type: 'error',
// message: t('appDebug.varKeyError.keyAlreadyExists', { key: tempPayload.variable }),
// })
// return
// }
if (!tempPayload.label) {
Toast.notify({ type: 'error', message: t('appDebug.variableConig.errorMsg.labelNameRequired') })
return