Merge remote-tracking branch 'origin/master' into feature/slicing
This commit is contained in:
@@ -41,7 +41,6 @@ export const FormSubscribePlanPage = (properties: TProperties) => {
|
||||
},
|
||||
})
|
||||
const [error, setError] = useState<string>()
|
||||
const [disabled, setDisabled] = useState(false)
|
||||
|
||||
const { handleSubmit, watch, setValue } = formMethods
|
||||
const watchName = watch('name')
|
||||
@@ -49,11 +48,9 @@ export const FormSubscribePlanPage = (properties: TProperties) => {
|
||||
useEffect(() => {
|
||||
if (!fetcher.data?.success) {
|
||||
setError(fetcher.data?.message)
|
||||
setDisabled(false)
|
||||
return
|
||||
}
|
||||
navigate('/lg-admin/subscribe-plan')
|
||||
setDisabled(true)
|
||||
setError(undefined)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [fetcher])
|
||||
@@ -100,7 +97,8 @@ export const FormSubscribePlanPage = (properties: TProperties) => {
|
||||
containerClassName="flex-1"
|
||||
/>
|
||||
<Button
|
||||
disabled={disabled}
|
||||
disabled={fetcher.state !== 'idle'}
|
||||
isLoading={fetcher.state !== 'idle'}
|
||||
type="submit"
|
||||
size="lg"
|
||||
className="text-md h-[42px] rounded-md"
|
||||
|
||||
Reference in New Issue
Block a user