feat: update subscription handling in context and components

This commit is contained in:
Ardeman
2025-03-03 08:41:38 +08:00
parent 722966f50e
commit a594227026
7 changed files with 116 additions and 28 deletions
+3 -1
View File
@@ -26,7 +26,8 @@ export const registerSchema = z
export type TRegisterSchema = z.infer<typeof registerSchema>
export const FormRegister = () => {
const { setIsLoginOpen, setIsRegisterOpen } = useNewsContext()
const { setIsLoginOpen, setIsRegisterOpen, setIsSuccessOpen } =
useNewsContext()
const [error, setError] = useState<string>()
const [disabled, setDisabled] = useState(false)
const fetcher = useFetcher()
@@ -51,6 +52,7 @@ export const FormRegister = () => {
setDisabled(true)
setError(undefined)
setIsRegisterOpen(false)
setIsSuccessOpen('register')
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [fetcher])